Repository navigation
[v7.x] fix: skip reconnecting for aborted requests (#5846) - #6004
Merged
mcollina merged 1 commit intoNov 20, 2026
Merged
Conversation
Fixes: nodejs#5845 Signed-off-by: Junaid-PK <junaidhussnain369@gmail.com> (cherry picked from commit fcdd5a6)
metcoder95
approved these changes
Nov 12, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v7.x #6004 +/- ##
==========================================
- Coverage 93.11% 93.11% -0.01%
==========================================
Files 112 112
Lines 37366 37371 +5
==========================================
+ Hits 34793 34797 +4
- Misses 2573 2574 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This relates to...
Backport of #5846 (fixes #5845 on main) to v7.x. Companion to #6003, which does the same for v6.x.
Rationale
v7.x has the same spurious reconnect that #5845 describes. When a request is aborted while its response body is still streaming,
onHttpSocketClosemakes the aborted request pending again, and_resumecallsconnect(client)before it looks atrequest.aborted. The client opens a second connection to the origin only to drop the request right after connecting.The regression test from #5846 fails on current v7.x (
0c74bec7): it observes 2 connections where 1 is expected.Changes
Features
N/A
Bug Fixes
Breaking Changes and Deprecations
N/A
Status
Tested locally on Linux with Node 24:
test/issue-5845.jsfails before the change and passes after it;eslint,test/fetch/*.js(456 pass),test/node-test/**(231 pass) andtest/interceptors/*.js(311 pass) all pass. Intest/*.js, 1316 tests pass and 0 fail;test/issue-4880.js(the h2 high-concurrency test) timed out when the whole suite ran in parallel on my 2-vCPU machine, and passes when run on its own, both with and without this change. I did not run the wpt, websocket or jest suites locally.