-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
[v12.x backport] async_hooks: add AsyncLocalStorage #32318
[v12.x backport] async_hooks: add AsyncLocalStorage #32318
Commits on Apr 14, 2020
-
async_hooks: add executionAsyncResource
Remove the need for the destroy hook in the basic APM case. Co-authored-by: Stephen Belanger <[email protected]> PR-URL: nodejs#30959 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8752332 - Browse repository at this point
Copy the full SHA 8752332View commit details -
async_hooks: executionAsyncResource matches in hooks
Ensure that resource returned by executionAsyncResource() in before and after hook matches that resource causing this before/after calls. PR-URL: nodejs#31821 Refs: nodejs#30959 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1f61d3c - Browse repository at this point
Copy the full SHA 1f61d3cView commit details -
src: move InternalCallbackScope to StartExecution
PR-URL: nodejs#31944 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for adc1afb - Browse repository at this point
Copy the full SHA adc1afbView commit details -
src: pass resource object along with InternalMakeCallback
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 <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 288663c - Browse repository at this point
Copy the full SHA 288663cView commit details -
async_hooks: introduce async-context API
Adding AsyncLocalStorage class to async_hooks module. This API provide a simple CLS-like set of features. Co-authored-by: Andrey Pechkurov <[email protected]> PR-URL: nodejs#26540 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0807da3 - Browse repository at this point
Copy the full SHA 0807da3View commit details -
async_hooks: add store arg in AsyncLocalStorage
This commit introduces store as the first argument in AsyncLocalStorage's run methods. The change is motivated by the following expectation: most users are going to use a custom object as the store and an extra Map created by the previous implementation is an overhead for their use case. Important note. This is a backwards incompatible change. It was discussed and agreed an incompatible change is ok since the API is still experimental and the modified methods were only added within the last week so usage will be minimal to none. PR-URL: nodejs#31930 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bedb27e - Browse repository at this point
Copy the full SHA bedb27eView commit details -
test: improve disable AsyncLocalStorage test
PR-URL: nodejs#31998 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for be305fe - Browse repository at this point
Copy the full SHA be305feView commit details -
test: add GC test for disabled AsyncLocalStorage
PR-URL: nodejs#31995 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ecc5935 - Browse repository at this point
Copy the full SHA ecc5935View commit details -
async_hooks: fix ctx loss after nested ALS calls
PR-URL: nodejs#32085 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5036117 - Browse repository at this point
Copy the full SHA 5036117View commit details -
async_hooks: add sync enterWith to ALS
This allows transitioning the entire following sync and async execution sub-tree to the given async storage context. With this one can be sure the context binding will remain for any following sync activity and all descending async execution whereas the `run*(...)` methods must wrap everything that is intended to exist within the context. This is helpful for scenarios such as prepending a `'connection'` event to an http server which binds everything that occurs within each request to the given context. This is helpful for APMs to minimize the need for patching and especially adding closures. PR-URL: nodejs#31945 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e9b3918 - Browse repository at this point
Copy the full SHA e9b3918View commit details -
test: add new scenario for async-local storage
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 <[email protected]> PR-URL: nodejs#32082 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2e04161 - Browse repository at this point
Copy the full SHA 2e04161View commit details -
benchmark: fix error on server close in AsyncLocalStorage benchmark
PR-URL: nodejs#32503 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 45ad080 - Browse repository at this point
Copy the full SHA 45ad080View commit details -
async_hooks: prevent sync methods of async storage exiting outer context
PR-URL: nodejs#31950 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4cd19bc - Browse repository at this point
Copy the full SHA 4cd19bcView commit details -
async_hooks: merge run and exit methods
PR-URL: nodejs#31950 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c6f7f55 - Browse repository at this point
Copy the full SHA c6f7f55View commit details -
doc: improve AsyncLocalStorage sample
PR-URL: nodejs#32757 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fce0272 - Browse repository at this point
Copy the full SHA fce0272View commit details