Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
async_hooks: unmerge resource_symbol from owner_symbol#40741
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
async_hooks: unmerge resource_symbol from owner_symbol#40741
Uh oh!
There was an error while loading. Please reload this page.
Conversation
RaisinTen commented Nov 6, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
targos commented Nov 6, 2021
@nodejs/diagnostics (btw @vdeturckheim would you like to be added to that team?) |
RaisinTen commented Nov 6, 2021
cc @nodejs/async_hooks |
This comment has been minimized.
This comment has been minimized.
vdeturckheim commented Nov 6, 2021
@targos thanks for the heads up, I am in @nodejs/async_hooks but it probably makes sense for me to join @nodejs/diagnostics too 🤔 |
targos commented Nov 6, 2021
@vdeturckheim I don't see you in the async_hooks team either. |
Uh oh!
There was an error while loading. Please reload this page.
Qard commented Nov 6, 2021
Seems I missed #38468... IMO, Seems to me like it'd be best to revert #38468 and keep those separate, or maybe an owner hierarchy where the regular |
RaisinTen commented Nov 7, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Could you please share some use cases that need the
In that case, I think bea58a1 should be fine?
If I'm not wrong, currently the |
Uh oh!
There was an error while loading. Please reload this page.
5ab8518 to 12abaf7Compareaddaleax commented Nov 7, 2021
I would also be curious about this – both |
Qard commented Nov 7, 2021
Any sort of connection pooling needs an AsyncResource rather than the public API object to express the individual task, because sharing a resource across multiple tasks will corrupt the context. This happens in http.Agent and many places in userland code. This is why the resource was separate from owner in the first place. It could be nested on the owner though, but I feel like we would want something a bit less fragile than a bunch of constructor name checks which, as I said, can be broken by simply sub-classing AsyncResource, which a bunch of userland already does. I do agree with the idea of simplifying this as much as we can, but what we're seeing here is that we simplified too much and broke the handle reuse code. We still need to handle that properly somehow, so I feel the removal of resource_symbol needs a bit more thought. I won't block on this PR, because this needs fixing quickly, but I would request at least a comment with a big, bold WARNING about the safety of constructor name checking and a TODO to improve the handling of that. |
RaisinTen commented Nov 11, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
If you're talking about handle reuse, I've added the tests back in 323f8a7, which I removed by mistake instead of fixing them in #38468, so I think it still works as expected.
Wasn't this already addressed in bea58a1 or am I missing something here? |
Qard commented Nov 11, 2021
Yep, I had missed those changes when I wrote that comment as I had left the tab open for awhile to review before commenting and it had not updated itself. The current way is better but I'm not a fan of putting a bunch of lazy loading in such a hot function. The I'm still feeling like reverting the previous change is the better solution. It kind of sucks having two similar purposed properties, but much better for performance than trying to compute that every time it's accessed, which will happen more or at least as much and requires more logic to map back to what it was than just the original storing the resource in a symbol property. |
323f8a7 to 2615107CompareAsyncLocalStorageresource_symbol from owner_symbolRaisinTen commented Nov 13, 2021
I ran some benchmarks locally and indeed there was a 23% slow down for |
This comment has been minimized.
This comment has been minimized.
Source: nodejs/node#40741 Pushed as orgads/node:16.13.0-asyncfix-alpine
Fixes: #40693 Signed-off-by: Darshan Sen <[email protected]> PR-URL: #40741 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 937bbc5. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 7ca2f13. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
RaisinTen commented Nov 18, 2021
orgads commented Nov 18, 2021
Thank you very much. Will it be backported to v16 automatically? |
RaisinTen commented Nov 18, 2021
orgads commented Nov 18, 2021
Thanks. |
Fixes: #40693 Signed-off-by: Darshan Sen <[email protected]> PR-URL: #40741 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 937bbc5. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 7ca2f13. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
willianpc commented Dec 29, 2021
Hello folks, is there a particular reason why this change was not back ported into v16.x yet? Cheers,
|
orgads commented Jan 10, 2022
When is the next 16 release planned? It's been a month since the last minor release. Previous releases were more frequent. I couldn't find a release roadmap/schedule anywhere. |
richardlau commented Jan 10, 2022
Currently planned for sometime in January nodejs/Release#658 |
Fixes: #40693 Signed-off-by: Darshan Sen <[email protected]> PR-URL: #40741 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 937bbc5. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 7ca2f13. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Fixes: #40693 Signed-off-by: Darshan Sen <[email protected]> PR-URL: #40741 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 937bbc5. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts commit 7ca2f13. PR-URL: #40741Fixes: #40693 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This reverts 7ca2f13 and 937bbc5 and adds some regression tests for the referenced issue.
Fixes: #40693
Signed-off-by: Darshan Sen [email protected]