Repository navigation
Fix serial tasks waiting on a reassigned task id - #10562
Merged
michaelstaib merged 2 commits intoOct 20, 2026
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
🟢 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
approved these changes
Oct 20, 2026
This was referenced Oct 25, 2026
Merged
This was referenced Nov 16, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 32 others
AdCodicem/AdCodicem.ValueObjects#262
Closed
This was referenced Nov 23, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 43 others
AdCodicem/AdCodicem.ValueObjects#274
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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