Skip to content

Fix serial tasks waiting on a reassigned task id - #10562

Merged
michaelstaib merged 2 commits into
ChilliCream:mainfrom
bbarry:feature/serial-task-reassigned-id
Oct 20, 2026
Merged

michaelstaib merged 2 commits into
ChilliCream:mainfrom
bbarry:feature/serial-task-reassigned-id

Conversation

@bbarry

@bbarry bbarry commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

The work scheduler read a serial task's id after starting it. A task that completes is returned to its pool and can be registered again under a new id before the scheduler waits for it, so the request waited for an id it never completes and hung without observing cancellation. The id is now read before the task starts.

fixes #10561

The work scheduler read a serial task's id after starting it. A task that
completes is returned to its pool and can be registered again under a new id
before the scheduler waits for it, so the request waited for an id it never
completes and hung without observing cancellation. The id is now read before
the task starts.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 19:31
@CLAassistant

CLAassistant commented Oct 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix addresses the task reuse race, and the regression test directly covers the reported failure.

0 open findings

What changed in this PR

Fixes #10561 by preserving a serial task’s ID before execution, preventing the scheduler from waiting indefinitely on an ID reassigned during pooled task reuse.

Changes:

  • Captures the task ID before starting execution.
  • Adds a deterministic regression test that reassigns the ID when the task returns to its pool.
File Description
src/​HotChocolate/​Core/​test/​Execution.Tests/​Processing/​WorkSchedulerTests.cs Verifies serial execution completes despite task ID reassignment.
src/​HotChocolate/​Core/​src/​Types/​Execution/​Processing/​WorkScheduler.Execute.cs Waits on the captured ID rather than the mutable task ID.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@michaelstaib
michaelstaib merged commit 88a331d into ChilliCream:main Oct 20, 2026
149 checks passed
This was referenced Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request hangs forever when a serial task's id is reassigned before the scheduler waits for it

4 participants