Repository navigation
Deliver H2 END_STREAM that arrives while read is throttled - #13780
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A deferred empty END_STREAM is converted to READ_READY and can still leave the transaction stalled.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Defers HTTP/2 origin read completion while throttled and adds regression coverage.
Changes:
- Tracks deferred
VC_EVENT_READ_COMPLETE. - Delivers completion when reads resume.
- Adds HTTP/2-origin chunked-flow tests.
| File | Description |
|---|---|
src/proxy/http2/Http2Stream.cc |
Defers and reschedules completion. |
src/proxy/http2/Http2ConnectionState.cc |
Routes END_STREAM through deferred handling. |
include/proxy/http2/Http2Stream.h |
Declares deferred-completion state. |
tests/gold_tests/chunked_encoding/chunked_flow_control.test.py |
Registers the regression replay. |
tests/gold_tests/chunked_encoding/replays/chunked_h2_origin_flow_control.replay.yaml |
Exercises throttled HTTP/2-origin responses. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bryancall
left a comment
There was a problem hiding this comment.
❌ Request changes
This fixes the hang in #13777 as observed, and the diagnosis and the rcv_data_frame restructuring are both right. Splitting "gated, so drop" from "throttled, so defer" is the correct shape. What holds it up is that the patch deliberately routes a second code path through the new deferral and that path still cannot complete, plus a third completion site it does not touch at all.
Verified: the reported hang is fixed
Worth stating plainly, because the rest of this is about paths you did not measure. The HTTP/2 unknown case of %d event warning is reachable only through the final else of the timeout arm (Http2Stream.cc:229-235), which requires read_vio.ntodo() == 0 — and that requires set_read_done() to have set nbytes = ndone. That call happens only on the data-bearing END_STREAM path. So the once-per-second warning in the issue is diagnostic of a final DATA frame with payload, and on that path the deferred replay works: ntodo() == 0 makes update_read_request derive VC_EVENT_READ_COMPLETE correctly.
Not addressed: the pure-END_STREAM path still cannot complete
Http2ConnectionState.cc:187 now routes the empty-DATA-frame path through signal_read_complete(), so it defers. But the replay does not carry the event — update_read_request re-derives it:
int send_event = VC_EVENT_READ_READY;
if (read_vio.ntodo() == 0 || (this->receive_end_stream && this->read_vio.nbytes != INT64_MAX)) {
send_event = VC_EVENT_READ_COMPLETE;
}Both disjuncts fail here. The branch returns at :188 and never reaches the set_read_done() at :265 — the only call site — so nbytes keeps what do_io_read set. For a re-chunked response that is INT64_MAX: server_transfer_init returns -1 for HTTP_UNDEFINED_CL, which becomes producer_n = INT64_MAX (HttpTunnel.cc:1073) and then do_io_read(this, INT64_MAX, …) (:1270). So ntodo() != 0, and the second clause requires nbytes != INT64_MAX, which is exactly false. The event degrades to READ_READY, and the gate below it (read_avail > 0 || send_event == READ_COMPLETE) means that if the consumer already drained — the reason it re-enabled — nothing is delivered at all.
Because the flag is cleared at :1062 before the call, there is no retry. The transaction then stalls to the timeout, though without the warning signature above, which is why this variant would not have shown up in the logs behind the issue.
Please don't apply the suggestion in the Copilot comment as written. Calling set_read_done() on this path fixes the common case but adds a new drop: it sets nbytes = ndone, and for a zero-length body delivered as HEADERS-then-empty-DATA, ndone == 0, so nbytes becomes 0 and trips the nbytes == 0 early return in both signal_read_complete() (:962) and signal_read_event() (:929). That case works today.
Carrying the event instead fixes this and the clear-before-delivery problem together, and keeps the scheduling property your comment claims (send_tracked_event ends in schedule_imm):
if (this->_read_complete_deferred) {
// Schedule rather than call back: the consumer re-enabling us is still on the stack.
this->read_event = this->send_tracked_event(this->read_event, VC_EVENT_READ_COMPLETE, &this->read_vio);
this->_read_complete_deferred = false;
}Worth confirming the thread discipline yourself — this skips the _switch_thread_if_not_on_right_thread call that update_read_request makes, and main_event_handler does that check on the way back in, but I have not run it.
Blocking: the flag is consumed before delivery is confirmed
Same root cause, stated separately because it survives any fix to the above. Http2Stream.cc:1062 clears _read_complete_deferred and then calls a function with early returns on closed, _proxy_ssn == nullptr, _sm == nullptr, read_vio.mutex == nullptr, a thread bounce, _read_event_paused, nbytes == 0, and is_disabled(). Any of those and the completion is gone with no record that it was owed. Clearing only on the branch that hands the event off makes the deferral idempotent at no cost.
Not addressed: a third completion site is left raw
Http2Stream::send_headers still calls signal_read_event() directly for an END_STREAM that rides on HEADERS rather than DATA — VC_EVENT_EOS at :392 for a response, VC_EVENT_READ_COMPLETE at :396 for a request. signal_read_event's own guard includes read_vio.is_disabled(), so while the producer is throttled these are dropped outright, with no deferral at all. Trailers reach this site: rcv_headers_frame routes them through set_expect_receive_trailer() + send_headers() at :587-592.
So an HTTP/2 origin that sends trailing headers after a large body, while the tunnel has it throttled, is the same bug on a path this patch leaves untouched — and the response branch is in the direction the issue is about. The fix looks small, since send_headers has already set nbytes (and, on the request branch, ndone) before signalling, so routing it through a deferral would replay cleanly.
I verified the code and the trailer routing. I did not establish how often an origin sends trailers into a throttled tunnel, so treat the reachability as argued rather than measured.
Blocking: the test cannot tell whether it exercised the fix
Both new transactions use content: size: N, so Proxy Verifier sets END_STREAM on the last payload-bearing DATA frame — the path that already works. The pure-END_STREAM path the patch newly touches has no coverage. Beyond that, neither assertion is specific to the fix: chunked_throttle >= 1 only shows a throttle happened somewhere, and the body-size equality is satisfied by a run that never entered the new code. If the race stops firing, the test stays green while covering nothing.
Three changes, all using machinery already in this directory's neighbours:
- Assert the deferral ran. The new
Http2StreamDebug("defer VC_EVENT_READ_COMPLETE …")line is already gated by a tag the replay enables, and the harness supportslog_validation: traffic_out: contains:—h2/replay/http2_client_reset_keeps_session_reading.replay.yamluses it exactly this way. This is the highest-value one: it turns a probabilistic test into a positive one. - Cover the pure-END_STREAM case with a
server-response: frames:sequence ending in an explicit zero-length DATA + END_STREAM. Adelay:on that frame also makes the throttle window deterministic rather than incidental. - Pin the origin protocol. Nothing currently fails if outbound ALPN falls back to
http/1.1, which would quietly reduce this to a copy of the h1 sibling. The house pattern is aproxy-request: protocol: { stack: http2 }verification node, as inh2/replay_h2origin/h1-client-h2-origin.yaml:32-38.
Verified: what the patch gets right
Checked against the source rather than assumed:
- The guard decomposition is exact.
is_read_enabled()is!_read_event_paused && nbytes != 0 && !is_disabled(); the new early return is the negation of the first two conjuncts with the third split into the defer branch. Nothing that used to be delivered is now dropped, and nothing newly signals. - The
restart_receiving(nullptr)move is not a regression. Pre- and post-patch gating is the same four conditions reordered. The session window also reopens on unthrottle, becausereenablecallsrestart_receiving(this)before the replay and its connection-level WINDOW_UPDATE block is unconditional. - "Schedule rather than call back" is accurate —
call_update == falsetakes thesend_tracked_eventbranch, which isschedule_imm. No synchronous re-entry, and the concern was real: the reenable arrives off the consumer's stack (HttpTunnel.cc:1734,:1802). VIO::reenable()clears_disabledbefore calling into the stream, so the replay is not blocked by its ownis_disabled()guard;reenable()is the only un-throttle path, with noenable()bypass, andreenable_reforwards to it.- Both test assertions are real.
proxy.process.http.tunnel.chunked_throttleis created atHttpConfig.cc:507;HTTP/2 unknown case ofis aWarning()atHttp2Stream.cc:234, and per the first section it is reachable on the path this test drives, so that exclusion is a well-chosen guard rather than decoration. enable_tls: falseis correct, not a misconfiguration. It gates only ATS's inbound ports and certs;{SERVER_HTTPS_PORT}resolves independently and the verifier server gets--listen-https, negotiating h2 by ALPN.- The 60000-byte first transaction is well chosen — it fits inside the default 65535
initial_window_size_out, so the origin sends the whole body back to back and END_STREAM lands inside the throttle window.
Non-blocking: smaller notes
transaction_active_timeout_out: 5is a hard cap on total transaction duration, not an idle bound. Transaction 2 pushes 512 KB through a 4096-byte water mark with two debug tags on under ASAN; the siblings usetransaction_no_activity_timeout_*: 10instead, which fails just as fast without risking a flake on a slow-but-progressing transfer. I have not measured this.- Consider pinning
exec_thread.autoconfig.enabled: 0, as both in-tree h2-origin tests do. With the defaultserver_session_sharing.pool: thread, transaction 2 may land on another thread and open a fresh origin session, so the comment about it interleaving throttle and WINDOW_UPDATE cycles on an established session may not hold. - Reset
_read_complete_deferredindo_io_read. A deferral recorded before a re-arm is dead state consumed by the next reenable. Hygiene, not a live bug — deferring requires the throttle, which requires the tunnel. - Stale comment in
update_read_request: "Called from do_io_read. Still setting things up." is now wrong, sincereenable()is a second caller of thefalsebranch. _read_event_paused || nbytes == 0now appears at:764,:929and:962alongsideis_read_enabled(); a named predicate would keep the four from drifting.
Not verified by execution — I did not build or run the AuTest, which is worth the cycles on a change heading for approval rather than one needing another pass.
83c6379 to
7a2f0bf
Compare
|
Thanks for the thorough review, @bryancall. I force-pushed an updated commit. Point by point: Pure END_STREAM / flag consumed before delivery. Fixed as you suggested. One thing I found while testing: on an outbound stream whose request has already ended (any GET), an empty END_STREAM DATA frame moves the stream to CLOSED, so it takes the Third completion site ( Test specificity. Done. Non-blocking notes:
|
7a2f0bf to
f73b5f6
Compare
bryancall
left a comment
There was a problem hiding this comment.
❌ Request changes
Three of the four asks are fixed, and the mechanism change is the right one — carrying the event instead of re-deriving it closes the pure-END_STREAM case and the clear-before-delivery problem together. The _is_read_gated() extraction is semantics-preserving at all three call sites, which I checked by substitution rather than by eye, and the trailers fix is now proven by CI rather than argued.
What holds it up is that the clear moved one step, not two. It now happens when the event is scheduled, and the same call stack can disable the VIO again before that event is dispatched.
Still blocking: the deferral is cleared at schedule time, and the same stack can re-throttle
Http2Stream.cc:1069-1070 schedules the event and zeroes the slot:
this->read_event = this->send_tracked_event(this->read_event, this->_deferred_read_event, &this->read_vio);
this->_deferred_read_event = 0;send_tracked_event ends in schedule_imm, so dispatch happens after reenable() unwinds. The eventual deliverer for READ_COMPLETE is signal_read_event(), whose guard includes read_vio.is_disabled().
The re-disable fires on that same stack. HttpTunnel.cc:1733-1740 — one of the two reenable sites you and I both identified last round — is:
p->read_vio->reenable();
// Sometimes producer needs synthetic VC_EVENT_READ_READY event to resume after hitting high water mark
if (p->is_handling_chunked_content() && p->chunked_handler.is_read_avail()) {
this->producer_handler(VC_EVENT_READ_READY, p);
}producer_handler on VC_EVENT_READ_READY reaches _throttle_chunked_producer(p) on both of its branches — :1447 before the chunked walk for buffered paths, :1467 after it for plain passthru — and that calls p->read_vio->disable() at :1406 as soon as a consumer is at high water. The passthru ordering is the clearer one, since the walk has just moved more bytes into the consumer buffer, and replays/chunked_passthru_flow_control.replay.yaml in this same directory shows that configuration is live.
So: reenable() schedules the READ_COMPLETE and clears the flag, producer_handler re-disables the VIO before the stack unwinds, the scheduled event dispatches into signal_read_event(), the is_disabled() guard drops it, and _deferred_read_event is already zero. The next unthrottle replays nothing, because reenable() no longer calls update_read_request. The transaction then sits until transaction_no_activity_timeout_out — the same hang this PR fixes.
You have already written the correct pattern for the sibling path. Http2Stream.cc:187-192 routes a retried terminal event back through signal_final_read_event() so it "must survive a throttle that started meanwhile" — that comment is exactly right, and it is the reasoning this path needs too. The symmetric fix looks small: route a terminal read_event through signal_final_read_event() in the VC_EVENT_READ_COMPLETE arm, and stop clearing at :1070. send_tracked_event already dedups on callback_event, so a repeated reenable() reuses the pending event rather than scheduling a second one, and the deferral stays idempotent.
Worth knowing why this is green: a deferred VC_EVENT_EOS is immune, because main_event_handler's EOS arm calls read_vio.cont->handleEvent() directly and never consults is_disabled(). So the trailers case is structurally safe and only the two READ_COMPLETE cases are exposed — and neither of them uses passthru. The asymmetry I would otherwise have flagged as a smell is what is masking this.
I verified the call chain by reading, not by running it.
Still blocking: the empty-DATA case does not reach the line it was added for
All three curl cases are plain GETs, so ATS sends HEADERS with END_STREAM and the outbound stream sits in HALF_CLOSED_LOCAL. In rcv_data_frame, receive_end_stream is set and change_state() runs before the pure-END_STREAM branch — and HALF_CLOSED_LOCAL + receive_end_stream goes straight to CLOSED. So Http2ConnectionState.cc:182-185 takes initiating_close() and returns, and signal_final_read_event() at :187 is never reached. initiating_close() then sends EOS through send_tracked_event on read_vio (Http2Stream.cc:709), which is not gated by is_disabled() and worked before this patch.
This is your own analysis — you wrote that a GET takes the initiating_close() branch and that the deferral applies only while the request side is still open. The next sentence says the test "includes an empty-DATA END_STREAM case as a regression guard", and the two read as though the second covers the first. It guards initiating_close(), which was never broken.
The log assertions cannot catch the gap either, because defer/deliver deferred VC_EVENT_READ_COMPLETE are already emitted by the data-end-stream case and the testers match anywhere in traffic_out. The file looks like it meant to do this per case — end_stream_cases binds event in the loop at :58-63 and never uses it.
:187 is reachable: OPEN + DATA + receive_end_stream without send_end_stream goes to HALF_CLOSED_REMOTE, not CLOSED, so a request whose body is still in flight gets there. A POST that is still sending when the response ends should do it.
Non-blocking: the origin can raise FlowControlError, silently
queue_body never consults connection.local_flow_control_window(). The connection-level window starts at 65535, so after one 60000-byte response it is down to 5535 until ATS's WINDOW_UPDATE is processed — and that only happens inside receive_data() in the recv loop. If ATS reuses the origin session across the three runs and a request's HEADERS lands in a recv before the WINDOW_UPDATE, send_data raises.
The failure would be silent in the worst way: the exception escapes queue_body and answer_requests, serve_connection's except covers only wrap_socket, so it kills a daemon thread onto stderr — and the test asserts only origin.Streams.stdout. You would see an unexplained curl timeout. A try/except around queue_body that prints to stdout would make it diagnosable even if it never fires. The replay pins exec_thread.limit: 1 to force session sharing; the custom-origin ATS does not pin it either way, so which behaviour you get is machine-dependent.
Non-blocking: the "deliver deferred" assertion proves scheduling, not delivery
Http2StreamDebug("deliver deferred ...") at :1068 fires before send_tracked_event at :1069, so the log line means the event was scheduled. Given the first item above, that is the gap the test cannot see through: the assertion described as "A deferred DATA END_STREAM must be delivered on re-enable" would keep passing in exactly the case where delivery is dropped. Moving the log after the send would make it mean what its description says.
Non-blocking: a comment that predicted its own breakage
Http2Stream.cc:387-396 says the EOS "will first flush the remaining content to consumers, after which the TUNNEL_EVENT_DONE will be fired", and ends "This can break if the implementation changes." Line 397 just changed from signal_read_event to signal_final_read_event, so that EOS can now be parked until a later reenable() and flush nothing in the meantime. The new test asserts defer VC_EVENT_EOS fires from exactly here, so the deferred outcome is known to happen. The implementation changed; the comment should too.
Non-blocking: smaller notes
Http2Stream.cc:188hardcodes a second copy of "which events are terminal". The authoritative copy is the set ofsignal_final_read_eventcall sites. Adding a terminal event elsewhere would silently revert this retry path to the old dropping behaviour, under mutex contention only — a bug that would never show up in test. A sharedis_terminal_read_event(int)would remove the landmine.BODY_SIZE = 60000is load-bearing twice over: under the 65535 initial window (above), and above the 4096 water mark with 16384-byte frames, which is what guarantees the throttle trips with three READ_READY opportunities and only two needed. The sibling replay explains its own size choice; this one should too, or someone will "tidy" it and quietly destroy the gating.time.sleep(HEADER_PAUSE_SECONDS)is the only synchronisation between header and body, and it sits inside the connection's event loop, so a second stream on one origin connection would serialise behind it against a 5s curl budget.tests/gold_tests/h2/trickle_server.pyis the local precedent for a timing-free origin.int _deferred_read_event = 0would read better as= VC_EVENT_NONE, compared against the same. The sentinel is provably safe —VC_EVENT_NONEis 0 and the lowest VC event is 100 — so this is spelling, not substance.Http2ConnectionState.cc:264carries a stale// TODO: set total written size to read_vio.nbytesimmediately above theset_read_done()that does exactly that. Free cleanup while you are in here.
What I checked, and what I did not
The merge-base is 527edda8a8 and both revisions have it as their direct parent, so the delta since the last round is exactly 233 insertions and 32 deletions with no rebase noise. _is_read_gated() substitutes identically at all three call sites. THREAD_ALLOC_INIT placement-constructs on both the fresh and recycled paths, so the in-class initialiser runs every time and no stale deferral survives stream reuse. The mutex-retry routing at :186-192 is correct and its comment is accurate. The rcv_data_frame restructuring keeps restart_receiving(nullptr) behind the same guard set, and per last round the session window still reopens on unthrottle.
Not verified by execution: I did not build or run the AuTest. The lead finding is a call chain I traced through HttpTunnel, and it deserves a runtime confirmation before you act on it — a passthru variant of /data-end-stream is the shape most likely to show it.
Three things I looked at and decided not to raise, in case they come up elsewhere. An all-padding END_STREAM frame leaves ndone at 0 and the terminal event is dropped — real, but the pre-patch code gated the same call on is_read_enabled(), which also tested nbytes != 0, so it is identical before and after and not this PR's to carry. The reenable() write to read_event under the session mutex looked like a lock inconsistency, but the consumer calling VIO::reenable() holds cont->mutex, and do_io_read sets read_vio.mutex = c->mutex, so it is the same lock every sibling site takes — implicit rather than missing. And the origin's except (ConnectionError, ssl.SSLError) around wrap_socket is correct, not a swallow: it handles the When.PortOpen readiness probe that never completes a handshake.
f73b5f6 to
1005f04
Compare
|
Thanks again, @bryancall. I force-pushed an updated commit. Point by point: Deferral cleared at schedule time. Fixed. A READ_COMPLETE that I couldn't reproduce the re-throttle at runtime, and I don't think an HTTP/2 producer can hit it today. The same-stack Empty-DATA case and
So with today's code, nothing throttles a stream whose request side is still open, and Per-case assertions. Each case now runs against its own ATS. The data and trailers cases each assert their own Non-blocking notes:
Locally, all 35 tests in the |
With HTTP/2 to origin, an HTTP/1.1 client receiving a re-chunked response larger than the buffer water mark could get the whole body but never the terminating chunk. The chunked tunnel disables the origin stream's read VIO when its output backs up. If END_STREAM arrived during that window, on a DATA frame or on trailers, the stream dropped the event that ends the read, and re-enabling the VIO only reopened the flow-control window. The transaction then sat until a timeout, logging "HTTP/2 unknown case" once a second. This patch has the stream remember the final read event it could not deliver because its read VIO was disabled, and schedule that same event once the consumer re-enables the VIO, deferring it again if the consumer has throttled once more by the time it is dispatched. The chunked flow-control AuTest gains an HTTP/2 origin case, plus a custom origin that ends the stream inside the throttle window on a DATA frame and on trailers. Fixes: apache#13777 Co-authored-by: Claude Opus 5.5 Medium
1005f04 to
1682316
Compare
bryancall
left a comment
There was a problem hiding this comment.
✅ Approve
Thanks for turning this around. All three blocking items from my last review are resolved, and I ran the new test against a build without the fix to confirm it catches the bug.
Fixed: a deferred completion survives the consumer throttling again
reenable() now reschedules _deferred_read_event through send_tracked_event, and the READ_COMPLETE arm sends final events through signal_final_read_event, so a completion that finds the VIO disabled again is deferred once more instead of lost. That's the pattern I was after.
Agreed: the re-throttle isn't reachable for an HTTP/2 producer today
You're right. The consumer's WRITE_READY reenable is gated on every consumer being below high water, and the post-walk passthru throttle needs chunked input, which an HTTP/2 origin never produces. Making the path robust anyway is still the right call.
Fixed: the empty-DATA case no longer claims to cover Http2ConnectionState.cc:187
It's now documented as guarding the initiating_close() path, which is what it exercises. I accept your argument that :187 can't defer today, since post buffers have water mark 0.
Fixed: per-case log assertions
One ATS per case with its own defer … / rescheduled deferred … expectations means one case can no longer satisfy another's checks.
Verified: red without the fix, green with it
I built dev-asan on the merge-base 527edda with the PR applied (head 1682316), then reverted only Http2Stream.{h,cc} and Http2ConnectionState.cc and kept every test file:
| case | with fix | without fix |
|---|---|---|
| existing replay: H2 origin END_STREAM while throttled | pass | fail, curl times out at 5 s |
data-end-stream (READ_COMPLETE) |
pass | fail, curl times out; no defer/rescheduled lines |
trailers (EOS) |
pass | fail, curl times out; hits the origin inactivity timeout |
empty-end-stream |
pass | pass (expected: nothing is deferred on this path) |
| the H1/H2-client/passthru throttle cases | pass | pass |
autest -C none --sandbox <sb> --directory tests/gold_tests --ats-bin=<install>/bin \
--build-root build-dev-asan -f chunked_flow_control
(The without-fix run used Test.ContinueOnFail = True locally so every case reported, not just the first failure.)
Non-blocking
- Re-add
tr.StillRunningAfter = tsinside the loop. It was dropped along with the shared ATS. Without it, an ATS that crashes after curl gets its response still passes the run, and a crash in the EOS/close path is exactly the regression this test should catch. - The
reenable()comment overstates the EOS case. "main_event_handler() defers the event once more" holds for READ_COMPLETE. A rescheduled EOS goes to the EOS arm, which callsread_vio.cont->handleEventwithout checkingis_disabled, so the EOS half of_is_final_read_eventin the READ_COMPLETE/READY arm can't be reached. Either narrow the comment or give the EOS arm the samesignal_final_read_eventtreatment.
With HTTP/2 to origin, an HTTP/1.1 client receiving a re-chunked response larger than the buffer water mark could get the whole body but never the terminating chunk. The chunked tunnel disables the origin stream's read VIO when its output backs up. If END_STREAM arrived during that window, on a DATA frame or on trailers, the stream dropped the event that ends the read, and re-enabling the VIO only reopened the flow-control window. The transaction then sat until a timeout, logging "HTTP/2 unknown case" once a second. This patch has the stream remember the final read event it could not deliver because its read VIO was disabled, and schedule that same event once the consumer re-enables the VIO, deferring it again if the consumer has throttled once more by the time it is dispatched. The chunked flow-control AuTest gains an HTTP/2 origin case, plus a custom origin that ends the stream inside the throttle window on a DATA frame and on trailers. Fixes: #13777 Co-authored-by: Claude Opus 5.5 Medium (cherry picked from commit 00a22f2)
|
Cherry-picked to the 10.2.x branch as 9edd5de for the 10.2.1 release. |


With HTTP/2 to origin, an HTTP/1.1 client receiving a re-chunked
response larger than the buffer water mark could get the whole body
but never the terminating chunk. The chunked tunnel disables the
origin stream's read VIO when its output backs up. If END_STREAM
arrived during that window, on a DATA frame or on trailers, the stream
dropped the event that ends the read, and re-enabling the VIO only
reopened the flow-control window. The transaction then sat until a
timeout, logging "HTTP/2 unknown case" once a second.
This patch has the stream remember the final read event it could not
deliver because its read VIO was disabled, and schedule that same event
once the consumer re-enables the VIO, deferring it again if the
consumer has throttled once more by the time it is dispatched. The
chunked flow-control AuTest gains an HTTP/2 origin case, plus a custom
origin that ends the stream inside the throttle window on a DATA frame
and on trailers.
Fixes: #13777
Co-authored-by: Claude Opus 5.5 Medium
🤖 Generated with Claude Code