Repository navigation
Conversation
Collaborator
|
Review requested:
|
When a server responds before it has read the whole request body, the client stops forwarding the socket's 'drain' to the request as soon as the response is complete. A writer that honors backpressure, such as a stream piped into the request, then never receives 'drain', never calls end(), and the socket keeps the process alive. Keep the 'drain' listener until the request has ended and remove it in responseKeepAlive() when the socket is released back to the pool. Fixes: nodejs#67763 Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
mcollina
force-pushed
the
fix-http-drain-after-response
branch
from
November 25, 2026 16:09
e2cac06 to
c7bdb39
Compare
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.
When a server responds before it has read the whole request body, the client
stops forwarding the socket's
'drain'event to the request as soon as theresponse is complete. A writer that honors backpressure, such as a stream
piped into the request, then never receives
'drain', never callsend(),and the socket keeps the process alive.
socketOnData()removed the'drain'listener as soon asparser.incomingwas complete, without checking whether the request was still writing and
waiting for
'drain'. With this change the listener stays attached until therequest has ended and is removed in
responseKeepAlive()when the socket isreleased back to the pool.
Fixes: #67763