Skip to content

fix: complete task reports after worker channel errors - #903

Merged
gabotechs merged 1 commit into
datafusion-contrib:mainfrom
joybestourous:joy/codex/worker-report-cleanup
Nov 19, 2026
Merged

gabotechs merged 1 commit into
datafusion-contrib:mainfrom
joybestourous:joy/codex/worker-report-cleanup

Conversation

@joybestourous

Copy link
Copy Markdown
Contributor

Motivation

A worker response-stream error returns early from worker_to_coordinator_task through ?, skipping the empty final reports normally inserted at end-of-stream. The query fails, but callers waiting for task metrics or completed dynamic filters can then wait indefinitely.

This extracts the pre-existing bug fix identified in the review of #852.

Solution

Move ownership of the two optional report stores into a private TaskReports drop guard in the existing worker response reader. Dropping the guard supplies defaults for missing reports, including on an early error. Receiving a real report takes its store out of the guard, so cleanup preserves that report.

The change is confined to report cleanup and adds no public API or scheduling changes.

Result

A regression test uses the existing localhost fixture and routing hook to fail worker response channels after query execution starts. It verifies that the error still reaches the caller and that both metrics and dynamic-filter collection complete. On upstream main (6347d36), the test timed out waiting for metrics; with this fix, it passes.

Local validation on Rust 1.95 with incremental compilation disabled:

  • Core crate tests with integration,system-metrics: 500 passed, 3 ignored, including unit tests, integration tests and doctests.
  • All-target Clippy with the same features and -D warnings.
  • Formatting and git diff --check.

The optional chaos, TPC-H, TPC-DS and ClickBench suites were not run.

@gabotechs gabotechs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice!

@gabotechs
gabotechs merged commit bfed2de into datafusion-contrib:main Nov 19, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants