http: align OutgoingMessage and ClientRequest destroy#32148
http: align OutgoingMessage and ClientRequest destroy#32148ronag wants to merge 9 commits intonodejs:masterfrom
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.
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.
|
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 |
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