Repository navigation
Fix request registration before synchronous batch delays #9439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9a4d0ec
test(Request): reproduce zero-delay batch registration race
tim-smart 4e032e3
Fix request registration before synchronous batch delays
tim-smart 6fbfaf1
test(Request): cover synchronous delay reentrancy and pooled reuse
tim-smart f7c9dc1
Simplify request batch registration and reword changeset
tim-smart fbc184d
test(Request): reduce synchronous delay coverage to one regression
tim-smart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "effect": patch | ||
| --- | ||
|
|
||
| Fix request resolvers with synchronously completing delays, including `RequestResolver.setDelay(0)` under `TestClock`, running an empty batch and failing instead of resolving the request. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add focused regression coverage for the reentrant-delay / pooled-batch behavior introduced here. The checkout adds only the single
setDelay(0)test (the targeted file runs 35 tests, not the 38 described in the PR), which does not enqueue a request from the delay, interrupt a delay by filling its batch, or reuse a pooled batch. Consequently the early fiber publication here and the removal of the execution-fiber writeback are untested lifecycle changes. Add the reentrantbatchN(2)and pooled-reuse ordering cases described in the PR, asserting completion and that interruption targets the correct delay fiber.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test count and coverage description were stale; I have corrected the PR body to one added regression and 35 passing Request tests. It now explicitly says that reentrant enqueueing and pooled-reuse ordering are not directly covered by the retained test.
I disagree that restoring both removed cases should block this fix. Tim explicitly requested the bare minimum of focused tests. The retained public-API regression reproduces the reported TestClock/microtask failure without the fix and checks both successful completion and exactly one non-empty batch (
[[1]]). Existing batch-limit and cancellation coverage remains unchanged. Independent review of this exact head found no concrete gap requiring another case.The lifecycle safeguards are intentional: publish the running delay fiber before user callbacks can reenter, retain the post-fork assignment for schedulers that yield before publication, guard against touching an already-executed batch, and avoid writing an execution fiber into a recycled batch. The implementation has not changed during the test reduction, including delay-before-collection ordering.
The coverage limitation you identify is real, but the request does not identify an incorrect outcome in the current implementation or a distinct essential regression that warrants reversing the requested reduction. I recommend retaining the single test. If there is a specific failing public-API scenario at this head, please provide it so we can assess one focused behavioral test rather than automatically restoring both lifecycle/ordering cases. No code or tests changed in this assessment.