Uh oh!
There was an error while loading. Please reload this page.
async_hooks: remove experimental onPropagate option - #46386
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.
jasnell
commented
Jan 28, 2023
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. |
Qard
commented
Jan 28, 2023
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Flarna
commented
Jan 30, 2023
Actually the O(n) cost is not introduced by Anyhow, following TC-39 sounds reasonable. Any hints that TC-39 will accept the |
Uh oh!
There was an error while loading. Please reload this page.
jasnell
commented
Jan 30, 2023
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
3c265faComparenodejs-github-bot
commented
Jan 30, 2023
jridgewell
commented
Jan 30, 2023
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. |
legendecas
commented
Jan 31, 2023
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. |
nodejs-github-bot
commented
Jan 31, 2023
nodejs-github-bot
commented
Feb 1, 2023
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>
jasnell
commented
Feb 1, 2023
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