-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: align OutgoingMessage and ClientRequest destroy #32148
Conversation
Added .destroyed property to OutgoingMessage and ClientRequest to align with streams. Fixed ClientRequest.destroy to dump res and re-use socket in agent pool aligning it with abort.
lib/_http_client.js
Outdated
} | ||
|
||
if (!this.aborted && !err) { | ||
err = connResetException('socket hang up'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, destroy()
will emit ECONNRESET
while abort
won't.
This comment has been minimized.
This comment has been minimized.
After this we might want to consider deprecating abort. |
b795096
to
36a003a
Compare
36a003a
to
54de489
Compare
There are some changes needed to be made, but I'm not at home atm, will comment in an hour. |
Removed the risky change with |
dae0286
to
88ce624
Compare
@nodejs/web-server-frameworks |
844adca
to
97bfd14
Compare
97bfd14
to
0998e9b
Compare
92207e2
to
0245e4e
Compare
a5199da
to
6f11b24
Compare
This comment has been minimized.
This comment has been minimized.
This reverts commit 6f11b24.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Awesome :D
I think it's a good idea to replace Lines 118 to 124 in 7bb4f95
with IncomingMessage.prototype.destroy = function destroy(error) {
if (this.req)
this.req.destroy(error);
}; |
@szmarczak See #32153 for that. |
Codecov Report
@@ Coverage Diff @@
## master #32148 +/- ##
=========================================
Coverage ? 97.04%
=========================================
Files ? 197
Lines ? 65027
Branches ? 0
=========================================
Hits ? 63108
Misses ? 1919
Partials ? 0
Continue to review full report at Codecov.
|
@nodejs/http |
@nodejs/tsc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Added .destroyed property to OutgoingMessage and ClientRequest to align with streams. Fixed ClientRequest.destroy to dump res and re-use socket in agent pool aligning it with abort. PR-URL: #32148 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Landed in 173d044 |
Will this be backported to v13.x? |
@szmarczak Not as it is right now, it's been labeled semver-major. |
Added .destroyed property to OutgoingMessage and ClientRequest
to align with streams.
Fixed ClientRequest.destroy to dump res and re-use socket in agent
pool aligning it with abort.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes