Uh oh!
There was an error while loading. Please reload this page.
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 into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
puzpuzpuz
commented
Jul 20, 2020
7d9619c to
ed432dcComparepuzpuzpuz
commented
Jul 20, 2020
Pushed an additional test to verify |
puzpuzpuz
commented
Jul 21, 2020
@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.
Uh oh!
There was an error while loading. Please reload this page.
ed432dc to
de40cbaComparepuzpuzpuz
commented
Jul 21, 2020
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, |
nodejs-github-bot
commented
Jul 23, 2020
Flarna
commented
Jul 27, 2020
puzpuzpuz
commented
Jul 27, 2020
@Flarna no problem at all. Thanks for the update! |
Uh oh!
There was an error while loading. Please reload this page.
de40cba to
5548f89CompareUh oh!
There was an error while loading. Please reload this page.
5548f89 to
2212e09Comparepuzpuzpuz
commented
Jul 29, 2020
@Flarna I've noticed one more place where we might loose async context. I'm talking about
So, I wonder if I should wrap |
Flarna
commented
Jul 29, 2020
@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. |
puzpuzpuz
commented
Jul 30, 2020
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. |
nodejs-github-bot
commented
Jul 30, 2020
puzpuzpuz
commented
Jul 30, 2020
Landed in 019ea07 |
puzpuzpuz
commented
Jul 30, 2020
@vdeturckheim@Flarna many thanks for your reviews! |
codebytere
commented
Nov 3, 2020
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