async_hooks: remove experimental onPropagate option#46386
async_hooks: remove experimental onPropagate option#46386jasnell wants to merge 1 commit intonodejs:mainfrom
Conversation
vdeturckheim
left a comment
There was a problem hiding this comment.
lgtm - aligned with @Qard here
GeoffreyBooth
left a comment
There was a problem hiding this comment.
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 <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
|
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 <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
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 <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Refs: #46374
The
onPropagateoption forAsyncLocalStorageis problematic for a couple of reasons:AsyncContextproposal.While it is still experimental, I recommend removing it while we can revisit the fundamental use cases in light of the coming
AsyncContextproposal./cc @nodejs/async_hooks