Fix a race condition that can leave a poll to not get cancelled during shutdown - #11841
Merged
rkannan82 merged 3 commits intoSep 3, 2026
Merged
Conversation
rkannan82
marked this pull request as ready for review
August 28, 2026 03:23
rkannan82
marked this pull request as draft
August 28, 2026 03:28
This was referenced Aug 28, 2026
rkannan82
marked this pull request as ready for review
September 1, 2026 21:14
Contributor
|
Claude finished @rkannan82's task in 4m 8s —— View job Reviewed 1 file, 3 findings. |
Register worker-instance polls before checking the shutdown cache so a concurrent shutdown either cancels the registered poll or leaves a cache marker that rejects it.
rkannan82
force-pushed
the
fix-worker-shutdown-poll-race
branch
from
September 1, 2026 21:16
8153846 to
f3bfb78
Compare
This was referenced Sep 1, 2026
dnr
approved these changes
Sep 2, 2026
rkannan82
enabled auto-merge (squash)
September 3, 2026 20:15
yiminc
approved these changes
Sep 3, 2026
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.
What changed?
Register worker polls before checking the shutdown cache.
Why?
Prevent a shutdown request from missing a poll that is still starting. The previous implementation handled polls that arrived after shutdown had populated the cache. It did not handle the case where the poll and shutdown calls are interleaved.
How did you test it?
Tried adding a unit test to verify this exact race; but this gets into the guts of the impl and makes it hard to read.