Repository navigation
test(falcon): bound the H1 campaign's withheld upload by its deadline - #240
Merged
Merged
Conversation
Since #192 Falcon reads a declared remainder under 256 KiB before it answers, as net/http does, so scenario 5's withheld 100 KB upload got its reply only when the default 60 s request_body_timeout expired. During that wait the server's 60 s idle_timeout retired the persistent client's idle connection, and every nightly Falcon lane failed its reuse check after warmup 1. The withheld upload now carries a 2 s Connect deadline, which bounds the read, and a second upload declares 1 MB, above the read limit, to keep the early-reply case the campaign covered before. Both replies are waited for within the settle bound, so a return to the 60 s wait fails at that step.
The withheld-upload check read the response body without decoding it, so an error end-stream under HTTP 200 would pass. It now requires the echoed message followed by an end-stream without an error. The comment on the deadline now says the two 60 s timers are independent.
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.
Change
The nightly Lifecycle campaign has failed its Falcon lane on both Rubies since 2026-11-23. Each failure is the same check in the HTTP/1.1 "5 slow peers" scenario:
The library is behaving as documented. The campaign's expectation is stale:
net/httpdoes (maxPostHandlerReadBytes). That is the Falcon Connect H1 retirement policy. Each read wait is bounded byrequest_body_timeout(60 s by default) and the whole read by the Connect deadline.HTTP1Transportclient's idle connection to the same server reaches the server's 60 sidle_timeoutand is retired. The client then reconnects for its next call. That is correct, but it breaks the campaign's reuse check, which expects the identical idle connection across rounds.The scenario now sends two withheld uploads:
Soak::TIMER_HEADROOM), which bounds the remainder read. The scenario still checks the documented outcome: a 200 reply, then the close, then the handler endingok.Both replies and the close must arrive within the settle bound (15 s). If a change brings back the 60 s wait, the campaign fails at the withheld upload with
Async::TimeoutError, not later at an unrelated reuse check. No library, documentation or other scenario changes.Cause and confirmation
5d5f5fc(three of three runs).085ab13, just before fix(falcon): read unread Connect HTTP/1 input before the response head #192, with fix(falcon): read unread Connect HTTP/1 input before the response head #192's own commitfc02871, using a probe that logs the persistent client's idle connection identity after each step. At085ab13the withheld step takes about 2 ms and the identity never changes. Atfc02871the step takes 60.0 s, the identity changes after it, and the failure reproduces.request_body_timeout: 2, the step takes 2.0 s, the identity stays stable, and the scenario passes.idle_timeout: 120and the defaultrequest_body_timeout, the step still takes 60 s, but the identity stays stable and the scenario passes.Other scenarios
I compared per-round times between the last green nightly run (45011759023) and the latest failure (47008460705), across both packages and both Rubies. No other scenario gained a wait near
request_body_timeoutoridle_timeout. The HTTP/2 "5 slow peers" scenario is unaffected because the read-first path is HTTP/1 only.Two scenarios did get slower in that window, by fractions of a second per round, and still pass:
1-churn4a-stuck-frameI have not attributed those increases to a commit; #197, which raised the async client cleanup allowance to 1 s, is a plausible cause.
Verification
All on head
6835a06unless noted.2fd4ad6was cancelled by the workflow's concurrency group when this one started.CONNECTRPC_SOAK_ROUNDS=50 mise run falcon:soak -- -e "5 slow peers (HTTP/1.1)"passed 2 of 2 times on Ruby 3.4.12 and 2 of 2 on 4.0.9, about 130.5 s each. Each Ruby also passed once more at2fd4ad6, before the body assertion was added.mise run falcon:soakpassed on both Rubies, all 13 scenarios.mise run falcon:testpassed on both Rubies (663 examples, 0 failures).mise run falcon:check,mise run checkandmise run falcon:verifypassed.Async::TimeoutError.internalend-stream that the old checks would have accepted.No library code or spec changed, so no new spec was needed.
gems/connectrpc-falcon/spec/http1_read_first_spec.rbalready covers the deadline-bounded read and the 256 KiB boundary.Written on behalf of jimeh by
claude-opus-5-5usingClaude CodeviaT3 Code.