-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
src: add ExecutionAsyncId getter for any Context #57820
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
Merged
nodejs-github-bot
merged 4 commits into
nodejs:main
from
szegedi:szegedi/async-id-any-context
Apr 17, 2025
Merged
src: add ExecutionAsyncId getter for any Context #57820
nodejs-github-bot
merged 4 commits into
nodejs:main
from
szegedi:szegedi/async-id-any-context
Apr 17, 2025
+28
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set.
legendecas
reviewed
Apr 10, 2025
Co-authored-by: Chengzhong Wu <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57820 +/- ##
=======================================
Coverage 90.23% 90.23%
=======================================
Files 630 630
Lines 185481 185470 -11
Branches 36373 36371 -2
=======================================
- Hits 167375 167368 -7
- Misses 10994 10998 +4
+ Partials 7112 7104 -8
🚀 New features to boost your workflow:
|
legendecas
approved these changes
Apr 10, 2025
This comment was marked as outdated.
This comment was marked as outdated.
jasnell
reviewed
Apr 13, 2025
jasnell
approved these changes
Apr 13, 2025
Flarna
approved these changes
Apr 17, 2025
Landed in ffb9bfb |
RafaelGSS
pushed a commit
that referenced
this pull request
May 1, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
RafaelGSS
pushed a commit
that referenced
this pull request
May 2, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 6, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 6, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
RafaelGSS
pushed a commit
that referenced
this pull request
May 14, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 16, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 17, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 17, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 17, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
pushed a commit
that referenced
this pull request
May 18, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
nodejs-github-bot
added a commit
that referenced
this pull request
May 19, 2025
Notable changes: deps: * update timezone to 2025b (Node.js GitHub Bot) #57857 doc: * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102 * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765 esm: * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011 * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 src: * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171 * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016 * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016 * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820 stream: * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865 util: * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879 worker: * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888 PR-URL: #58388
aduh95
pushed a commit
that referenced
this pull request
May 19, 2025
Adds a variant of AsyncHooksGetExecutionAsyncId that takes a V8 Context and returns the async ID belonging to the Environment (if any) of that Context. Sometimes we want to use Isolate::GetEnteredOrMicrotaskContext insteads of Isolate::GetCurrentContext (e.g. recording the async ID in a V8 GC prologue callback) when current context is not set. PR-URL: #57820 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
aduh95
added a commit
that referenced
this pull request
May 19, 2025
Notable changes: deps: * update timezone to 2025b (Node.js GitHub Bot) #57857 doc: * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102 * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765 esm: * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011 * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 src: * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171 * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016 * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016 * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820 stream: * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865 util: * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879 worker: * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888 PR-URL: TODO
aduh95
added a commit
that referenced
this pull request
May 19, 2025
Notable changes: deps: * update timezone to 2025b (Node.js GitHub Bot) #57857 doc: * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102 * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765 esm: * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011 * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 src: * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171 * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016 * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016 * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820 stream: * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865 util: * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879 worker: * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888 PR-URL: #58388
aduh95
added a commit
that referenced
this pull request
May 19, 2025
Notable changes: deps: * update timezone to 2025b (Node.js GitHub Bot) #57857 doc: * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102 * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765 esm: * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011 * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 src: * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171 * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016 * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016 * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820 stream: * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865 util: * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879 worker: * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888 PR-URL: #58388
aduh95
added a commit
to aduh95/node
that referenced
this pull request
May 20, 2025
Notable changes: deps: * update timezone to 2025b (Node.js GitHub Bot) nodejs#57857 doc: * add dario-piotrowicz to collaborators (Dario Piotrowicz) nodejs#58102 * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) nodejs#57765 esm: * (SEMVER-MINOR) graduate import.meta properties (James M Snell) nodejs#58011 * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) nodejs#57610 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) nodejs#57490 src: * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) nodejs#57171 * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) nodejs#57016 * (SEMVER-MINOR) add config file support (Marco Ippolito) nodejs#57016 * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) nodejs#57820 stream: * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) nodejs#57865 util: * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) nodejs#57879 worker: * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) nodejs#57888 PR-URL: nodejs#58388
aduh95
added a commit
that referenced
this pull request
May 21, 2025
Notable changes: deps: * update timezone to 2025b (Node.js GitHub Bot) #57857 doc: * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102 * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765 esm: * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011 * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610 sqlite: * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490 src: * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171 * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016 * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016 * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820 stream: * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865 util: * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879 worker: * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888 PR-URL: #58388
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
async_hooks
Issues and PRs related to the async hooks subsystem.
c++
Issues and PRs that require attention from people who are familiar with C++.
commit-queue-squash
Add this label to instruct the Commit Queue to squash all the PR commits into the first one.
needs-ci
PRs that need a full CI run.
semver-minor
PRs that contain new features and should be released in the next minor version.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a variant of
node::AsyncHooksGetExecutionAsyncId
that takes av8::Local<v8::Context>
and returns the async ID belonging to thenode::Environment
(if any) of that Context.This is not dissimilar to how e.g.
node::Environment::GetCurrent
method also exists with overloads for bothv8::Isolate*
andv8::Local<v8::Context>
.In certain situations it would be useful to pass a Context object different from
v8::Isolate::GetCurrentContext
, e.g. the one returned byv8::Isolate::GetEnteredOrMicrotaskContext
would be useful in recording the async ID in a V8 GC prologue callback when current context is not set.