-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: remove experimental onPropagate option #46386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though @Flarna may have some thoughts as I believe they're depending on this interface. Not sure how critical it is but they may want a viable alternative proposed before this can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - aligned with @Qard here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of aligning our development of this with WinterCG.
I don’t really accept that it’s our responsibility to develop replacements for any users depending on an experimental API. If they want a new feature in Node, they should propose and contribute it.
Well, to be fair, that's exactly what @Flarna did :-) ... There's no rush pushing this out. We can give Flarna time to revisit if they want. |
To be clear, I'm fine removing it as long as @Flarna doesn't feel it's too disruptive. I'm not aware of anyone else using it. |
This comment was marked as outdated.
This comment was marked as outdated.
Actually the O(n) cost is not introduced by Anyhow, following TC-39 sounds reasonable. Any hints that TC-39 will accept the |
Work is underway now. With @jridgewell, @legendecas, and @littledan heading it up. |
This comment was marked as outdated.
This comment was marked as outdated.
Refs: nodejs#46374 The `onPropagate` option for `AsyncLocalStorage` is problematic for a couple of reasons: 1. It is not expected to be forwards compatible in any way with the upcoming TC-39 `AsyncContext` proposal. 2. It introduces a non-trivial O(n) cost invoking a JavaScript callback for *every* AsyncResource that is created, including every Promise. While it is still experimental, I recommend removing it while we can revisit the fundamental use cases in light of the coming `AsyncContext` proposal.
c08df91
to
3c265fa
Compare
We'll have a better idea of how long it will take after the TC39 meeting this week. For now, I think it's better to think of this as aligning with the implementation strategy that
I've been meeting with delegates for a few weeks getting feedback on the proposal. We've gotten approval from the security folks, which was a major blocker the last time this was presented. We also have a private matrix channel to discuss that will become public when we get accepted to Stage 1. |
Value propagation can be optimized to avoid the complexity with the number of AsyncLocalStorage instances, as the propagation doesn't calling into user code. See https://github.com/legendecas/proposal-async-context/blob/master/src/index.ts#L7 for an example. |
Commit Queue failed- Loading data for nodejs/node/pull/46386 ✔ Done loading data for nodejs/node/pull/46386 ----------------------------------- PR info ------------------------------------ Title async_hooks: remove experimental onPropagate option (#46386) Author James M Snell (@jasnell) Branch jasnell:remove-asynclocalstorage-onpropagate -> nodejs:main Labels async_hooks, author ready Commits 1 - async_hooks: remove experimental onPropagate option Committers 1 - James M Snell PR-URL: https://github.com/nodejs/node/pull/46386 Refs: https://github.com/nodejs/node/issues/46374 Reviewed-By: Stephen Belanger Reviewed-By: Vladimir de Turckheim Reviewed-By: Geoffrey Booth Reviewed-By: Benjamin Gruenbaum Reviewed-By: Gerhard Stöbich Reviewed-By: Chengzhong Wu ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/46386 Refs: https://github.com/nodejs/node/issues/46374 Reviewed-By: Stephen Belanger Reviewed-By: Vladimir de Turckheim Reviewed-By: Geoffrey Booth Reviewed-By: Benjamin Gruenbaum Reviewed-By: Gerhard Stöbich Reviewed-By: Chengzhong Wu -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 27 Jan 2023 22:08:13 GMT ✔ Approvals: 6 ✔ - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/46386#pullrequestreview-1273599442 ✔ - Vladimir de Turckheim (@vdeturckheim): https://github.com/nodejs/node/pull/46386#pullrequestreview-1273608580 ✔ - Geoffrey Booth (@GeoffreyBooth) (TSC): https://github.com/nodejs/node/pull/46386#pullrequestreview-1273724192 ✔ - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/46386#pullrequestreview-1273975929 ✔ - Gerhard Stöbich (@Flarna): https://github.com/nodejs/node/pull/46386#pullrequestreview-1276087836 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/46386#pullrequestreview-1276289905 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-01-31T02:24:58Z: https://ci.nodejs.org/job/node-test-pull-request/49270/ - Querying data for job/node-test-pull-request/49270/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 46386 From https://github.com/nodejs/node * branch refs/pull/46386/merge -> FETCH_HEAD ✔ Fetched commits as 088e470dcdaa..3c265fa0aace -------------------------------------------------------------------------------- [main 60f40eb7a8] async_hooks: remove experimental onPropagate option Author: James M Snell Date: Fri Jan 27 14:03:51 2023 -0800 3 files changed, 6 insertions(+), 79 deletions(-) delete mode 100644 test/async-hooks/test-async-local-storage-stop-propagation.js ✔ Patches applied -------------------------------------------------------------------------------- ✖ Git found no trailers in the original commit message, but 'Refs: https://github.com/nodejs/node/issues/46374' is present and should be a trailer.https://github.com/nodejs/node/actions/runs/4065850372 |
The `onPropagate` option for `AsyncLocalStorage` is problematic for a couple of reasons: 1. It is not expected to be forwards compatible in any way with the upcoming TC-39 `AsyncContext` proposal. 2. It introduces a non-trivial O(n) cost invoking a JavaScript callback for *every* AsyncResource that is created, including every Promise. While it is still experimental, I recommend removing it while we can revisit the fundamental use cases in light of the coming `AsyncContext` proposal. Refs: #46374 PR-URL: #46386 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Landed in dc90810 |
The `onPropagate` option for `AsyncLocalStorage` is problematic for a couple of reasons: 1. It is not expected to be forwards compatible in any way with the upcoming TC-39 `AsyncContext` proposal. 2. It introduces a non-trivial O(n) cost invoking a JavaScript callback for *every* AsyncResource that is created, including every Promise. While it is still experimental, I recommend removing it while we can revisit the fundamental use cases in light of the coming `AsyncContext` proposal. Refs: #46374 PR-URL: #46386 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
The `onPropagate` option for `AsyncLocalStorage` is problematic for a couple of reasons: 1. It is not expected to be forwards compatible in any way with the upcoming TC-39 `AsyncContext` proposal. 2. It introduces a non-trivial O(n) cost invoking a JavaScript callback for *every* AsyncResource that is created, including every Promise. While it is still experimental, I recommend removing it while we can revisit the fundamental use cases in light of the coming `AsyncContext` proposal. Refs: #46374 PR-URL: #46386 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Refs: #46374
The
onPropagate
option forAsyncLocalStorage
is problematic for a couple of reasons:AsyncContext
proposal.While it is still experimental, I recommend removing it while we can revisit the fundamental use cases in light of the coming
AsyncContext
proposal./cc @nodejs/async_hooks