Repository navigation
Tolerate a late peer request in the cluster late-handoff test - #8892
Merged
Merged
Conversation
"a peer's request a DO's late handoff releases is answered moved" asserts that node 0 logs answering moved to a peer's request that waited for its handoff. That only happens if the request reaches node 0 before its in-flight deadline, 2 s into the 4 s stop. A request that arrives later finds the object already handed off and is answered moved without waiting, so nothing is logged. This failed once on a macOS CI runner where node 0 stalled during the drain. A missing log line is now reported with a diagnostic that says how far into the stop the test sent the request, rather than failing the test. The outcome is still asserted: the peer's request gets a 200 from node 1 with the expected count, the held request a 500, and node 0 exits cleanly. Those assertions alone catch node 0 relaying the waiting request instead of answering moved, since the relay is cut off at the connections deadline and the peer gets a 500.
There was a problem hiding this comment.
💬 Approved with comments — Test-only fix for a timing-dependent failure. One optional suggestion: keep the log assertion on runs that sent the request early.
Findings: 1 suggestion (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 suggestion
The log assertion is now a diagnostic only, so a regression in the waiting path can pass without anyone noticing.
Recommendation: 💬 Optional Nits
- [SUGGESTION] The waiting path is no longer asserted, even on runs where the request was sent well before the 2 s in-flight deadline. (
src/workerd/server/tests/cluster/cluster-test.mjs:2755)
View full review
src/workerd/server/tests/cluster/cluster-test.mjs:2755: The test now passes whether or not node 0 made the peer's request wait for its handoff. If a later change makes node 0 answer moved right away, or stops it waiting, the outcome assertions still hold, and at.diagnosticline is easy to miss in CI. One option is to keep the hard assertion whensentAfteris well under the 2 s in-flight deadline (for example under 1000 ms), and use the diagnostic only when the request was sent late.
✅ All other checks passed
🔒 Security: ✅ LGTM
No security concerns in this test-only change.
📝 Documentation: ✅ LGTM
The updated comment accurately describes both cases the test now tolerates.
Reviewed commit: 447546b1
jasnell
approved these changes
Nov 25, 2026
ry
approved these changes
Nov 25, 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.
This keeps the cluster test "a peer's request a DO's late handoff
releases is answered moved" from failing when a CI machine stalls
during the drain. It failed once that way, on a macOS runner.
The test asserted that node 0 logs answering moved to a peer's request
that waited for its handoff. That only happens if the request reaches
node 0 before its in-flight deadline, 2 s into the 4 s stop. A request
that arrives later finds the object already handed off and is answered
moved without waiting, so nothing is logged, although the request
still succeeds on node 1.
far into the stop the test sent the request, rather than failing.
node 1 with the expected count, the held request a 500, and node 0
exits cleanly. These alone catch node 0 relaying the waiting request
instead of answering moved: the relay is cut off at the connections
deadline and the peer gets a 500.