rp-arielrodriguez opened a new pull request, #711:
URL: https://github.com/apache/httpcomponents-core/pull/711
We found this with HTTP/2 multiplexing in HttpClient 5: when the server sent
GOAWAY(NO_ERROR) during a restart, requests on the same connection that the
server did not process were not failed. They waited until the server closed
the connection.
On GOAWAY(NO_ERROR), `AbstractH2StreamMultiplexer` must fail the local
streams
with an id greater than Last-Stream-ID with `RequestNotExecutedException`
(RFC 9113, section 6.8). The check used `!streams.isSameSide(...)`, so it
selected streams initiated by the peer instead.
Fix: drop the negation (one line).
Measured with an end-to-end test (real client, raw-frame server that sends
GOAWAY last-stream-id=1 with stream 3 in flight and closes the connection 3s
later):
| Stream 3 (not processed) | Result |
|---|---|
| master | `ConnectionClosedException` after ~3.2s (at connection close) |
| with fix | `RequestNotExecutedException` immediately |
Stream 1 completes normally in both cases. I did not include that test, to
keep
the change small; I can add it if you want it.
The same line is on 5.4.x, so the fix applies there as is.
Tests:
- New: `testGoAwayNoErrorFailsUnprocessedLocalStreamsOnly` (fails on master,
passes with the fix).
- Changed: `testGoAwayReservedBitInLastStreamIdAffectsStreamCulling` used
remote
streams, so it depended on the inverted check. It now uses local streams
and
still checks that the reserved bit is masked.
- `./mvnw -pl httpcore5-h2,httpcore5-testing -am test`: all pass
(httpcore5-h2
387, httpcore5-testing 443 with 4 skipped). Checkstyle and RAT pass.
I used an AI assistant (Claude Code) for this change. I reviewed all of it
and
I can answer questions about it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]