fix(netty): fail fast when InputStream body cannot be reset - #2312
Merged
hyperxpro merged 3 commits intoAug 16, 2026
Merged
Conversation
HTTP/1 path silently returned after a warn when a consumed non-resettable InputStream body was reused, leaving a half-sent request that hung until timeout. Throw IOException so sendHttpRequest aborts the future (matches existing HTTP/2 behavior). Composer 2.5 on behalf of arimu1 Fixes AsyncHttpClient#1973 Co-Authored-By: Composer 2.5 <composer@cursor.com>
Composer 2.5 on behalf of arimu1 Co-Authored-By: Composer 2.5 <composer@cursor.com>
hyperxpro
requested changes
Aug 15, 2026
Unsolicited HTTP/1 100 Continue was replaying bodies that were already sent. Guard with bodyWasDeferred like HTTP/2. Treat a failed reset() on a closed markable stream as unreplayable so retries abort the future instead of hanging or throwing Stream closed. Comments now cite NettyRequestSender.writeRequest. Addresses review on AsyncHttpClient#2312. Composer 2.5 on behalf of arimu1 Co-Authored-By: Composer 2.5 <composer@cursor.com>
Contributor
Author
|
Addressed the CHANGES_REQUESTED review (commit
Happy to follow up if anything still looks off. |
hyperxpro
approved these changes
Aug 16, 2026
Member
|
Thanks a lot! |
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.
Summary
InputStreamrequest body used to log a warning and return, leavingNettyRequestSender.writeRequestwithout completing the future so the request hung until timeout (Failed stream request hangs until timeout #1973). Headers usedchannel.writewith no flush; the peer has seen nothing.IOExceptioninstead sowriteRequestaborts the future. A failedreset()on a closed markable stream (for exampleBufferedInputStreamafterWriteProgressListenercloses it) is treated the same way, so retries fail fast instead of hanging or throwing only "Stream closed".bodyWasDeferredguard as HTTP/2, so an unsolicited 100 (RFC 9110 15.2.1) does not replay a body that was already sent.write,writeHttp2, thewriteRequestabort path, and a real request replay.Fixes #1973
AI disclosure
Composer 2.5 on behalf of arimu1 (Cursor harness). Commit includes
Co-Authored-By: Composer 2.5perAGENTS.md.Test plan
./mvnw -pl client -Dtest=NettyInputStreamBodyTest,Continue100InterceptorTest,NettyRequestSenderConsumedBodyRetryTest test(JDK 17)Made with Cursor