async_hooks: don't reuse resource in HttpAgent when queued#34439
async_hooks: don't reuse resource in HttpAgent when queued#34439puzpuzpuz wants to merge 1 commit intonodejs:masterfrom
Conversation
7d9619c to
ed432dc
Compare
|
Pushed an additional test to verify |
|
@nodejs/async_hooks I'd appreciate some reviews here. 🙏🏻 |
vdeturckheim
left a comment
There was a problem hiding this comment.
LGTM - do we have a benchmark for this? It should not impact too much but still.
ed432dc to
de40cba
Compare
I've checked existing benchmarks and the |
|
Here is the |
|
I've done another run of the benchmark and this time it gave slightly different results: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/650 Looks like the benchmark involves a lot of jitter, yet it makes me thinking that there is no significant performance degradation introduced by this fix. After all, |
|
@Flarna no problem at all. Thanks for the update! |
de40cba to
5548f89
Compare
5548f89 to
2212e09
Compare
|
@Flarna I've noticed one more place where we might loose async context. I'm talking about
So, I wonder if I should wrap |
|
@puzpuzpuz I'm not that deep into the HttpAgent flow. Maybe start by creating a test which reproduces the problem you think you found. If you fail it's maybe a code path which can't happen. |
@Flarna yeah, I see. Then I'm going to double check the path and try to reproduce it with a test. Going to update this PR, if necessary, and notify the reviewers. |
Update. I've checked the code path and we should be ok with the fix, as the Going to re-run CI tests and land the fix. |
PR-URL: #34439 Fixes: #34401 Refs: #27581 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
|
Landed in 019ea07 |
|
@vdeturckheim @Flarna many thanks for your reviews! |
PR-URL: #34439 Fixes: #34401 Refs: #27581 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
|
Blocked on #32801 |
Fixes: #34401
Refs: #27581
Checklist
This PR is a continuation of the
http.Agentasync resource reuse fix started in #27581. It deals with the case when a socket is not available immediately and, thus, the request is pushed into agent's queue.make -j4 test(UNIX), orvcbuild test(Windows) passes