src: pass resource object along with InternalMakeCallback#32063
src: pass resource object along with InternalMakeCallback#32063addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: nodejs#30959 Fixes: nodejs#32060
| Context::Scope context_scope(env->context()); | ||
| MaybeLocal<Value> ret = | ||
| InternalMakeCallback(env, recv, callback, argc, argv, asyncContext); | ||
| InternalMakeCallback(env, recv, recv, callback, argc, argv, asyncContext); |
There was a problem hiding this comment.
Not directly related to this PR but to executionAsyncResource(): Maybe we should add some ToDo comment here that we should get rid of using receiver as resource here? I think this is one of the major gaps between asyncIds (part of parameter asyncContext here) and async resources.
There was a problem hiding this comment.
executionAsyncResource() wasn’t really introduced with a plan for addons/embedders in mind, I’m afraid … I’ve been thinking about how to approach this, and ultimately, it probably makes sense to include the resource as a v8::Global in the async_context struct… that might come with some overhead, but I feel like that’s the only solution that’s going to make sure that the resource + the IDs actually match?
There was a problem hiding this comment.
I thought about the same.
But after I saw how simple async_context is and that this simple structure is relied on at several places (at least as far as I remember) I stopped walking deeper into it...
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: nodejs#32063 Refs: nodejs#32060 Refs: nodejs#32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com>
|
Fast-track? Might be nice to get this into #32099. (Only red CI failure is sequential/test-timers-blocking-callback, which is causing macOS trouble elsewhere too.) |
|
Landed in 787143b |
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: #30959 Fixes: #32060 PR-URL: #32063 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: #30959 Fixes: #32060 PR-URL: #32063 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: #32063 Refs: #32060 Refs: #32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: #32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: #32063 Refs: #32060 Refs: #32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: #32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: #32063 Refs: #32060 Refs: #32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: #32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: nodejs#30959 Fixes: nodejs#32060 PR-URL: nodejs#32063 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: nodejs#30959 Fixes: nodejs#32060 PR-URL: nodejs#32063 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: nodejs#32063 Refs: nodejs#32060 Refs: nodejs#32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: nodejs#32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: nodejs#30959 Fixes: nodejs#32060 PR-URL: nodejs#32063 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: nodejs#32063 Refs: nodejs#32060 Refs: nodejs#32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: nodejs#32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This was an oversight in 9fdb6e6. Fixing this is necessary to make `executionAsyncResource()` work as expected. Refs: #30959 Fixes: #32060 PR-URL: #32063 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a new scenario of multiple clients sharing a single data callback function managing their response data through AsyncLocalStorage APIs Refs: #32063 Refs: #32060 Refs: #32062 (comment) Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: #32082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This was an oversight in 9fdb6e6.
Fixing this is necessary to make
executionAsyncResource()workas expected.
Refs: #30959
Fixes: #32060
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes