Repository navigation
test(middleware): accept unknown-outcome failures in the hand-over test - #6251
matthewgrossman wants to merge 4 commits into
Conversation
…st (fixes #6250) Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…test Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
There was a problem hiding this comment.
gator-agent
PR Review Status
The test can allow transport failures with unknown outcomes during a service hand-over. The new aggregate assertion leaves two behaviors from #6250 unverified: a logical call must reach a handler at most once, and a call explicitly refused before processing must be retried.
Action required: Track handler invocations per logical call and add a deterministic hand-over retry case for an explicitly refused call.
Blocking findings:
GATOR-e50debec-01: The aggregate count can hide a duplicate handler invocation and a missed retry.
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: Focused middleware test fix for the macOS Branch Checks flake in #6250.
- Docs: No direct user-facing behavior changes.
- Checks: Branch Checks running at review time. DCO and the other reported required CI gates passed.
- E2E: No additional suite needed for this test-only patch.
- Head SHA:
e50debec040b3a4946d286770220af9453a2acef - Base SHA:
b7626bfb61951301ae6e511afde250d7c6ab64cb - Merge base SHA:
8131ae0b6e08caceaf706253bcf7a6edeadda6c0 - Patch ID:
1f2464fff4ea3c4b60436049333d54b035301754 - Gator payload:
24 - Review mode: initial
- Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
| "every call reached a handler exactly once" | ||
| let handled = handled.load(Ordering::SeqCst); | ||
| assert!( | ||
| handled <= calls, |
There was a problem hiding this comment.
gator-agent
Warning · GATOR-e50debec-01 · The aggregate count can hide hand-over retry regressions
Summary During a service hand-over, a call that never reaches a handler can offset a duplicate invocation for another call. The assertion also passes if a stream the server explicitly refused before processing is never retried. Both regressions can pass CI.
Fix Carry a stable logical call ID across attempts and assert at most one handler invocation per ID. Add a deterministic hand-over case that explicitly refuses the first stream before handler entry and requires the same call to reach the replacement service. Keep allowing unknown-outcome failures in the stress test.
Verify Script two logical calls. Deliver one twice and explicitly refuse the other before handler entry with retries disabled. The current assertion accepts two invocations for two calls. The new checks should catch the duplicate and require the refused call to reach the replacement handler.
Agent context
- Location:
crates/openshell-supervisor-middleware/src/remote.rs:608
Summary
During a service hand-over, some calls can fail with an outcome the client can't know: the old server closes the connection while the client is still writing, so
call_with_retriescorrectly doesn't send them again.unary_calls_are_answered_once_across_service_hand_oversexpected every call to be answered, so it failed intermittently. Which calls fail depends on timing, so the test can't assert on answers or failure counts without flaking. It now checks only what holds on every run: across hand-overs, a handler never runs more times than calls were made.Related Issue
Closes #6250
Changes
calls_reach_a_handler_at_most_once_across_service_hand_overs.handled <= calls. Sending a call again after a handler ran can break that bound.How the race happens (from an h2 trace)
GOAWAY(MAX), thenGOAWAY(37), ignores later streams, and closes the connection.h2client keeps opening streams (39 to 49) after the firstGOAWAY.GOAWAY(37), so those streams end withstream closed because of a broken pipeinstead of a refusal.call_with_retriesdoesn't send it again.a_call_the_service_received_is_not_sent_again_after_a_resetrequires this.Follow-up (not in this PR)
The production middleware path (
call_with_retriesincrates/openshell-supervisor-middleware/src/lib.rs) can also fail a few calls this way during real hand-overs. A follow-up could reduce this at the source: have the client stop opening streams once it seesGOAWAY, or have the draining server keep reading briefly before it closes.Testing
cargo test -p openshell-supervisor-middleware --lib remote::passes; fmt and clippy clean.Checklist