GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — async_hooks: fix context loss after nested calls to AsyncLocalStorage by puzpuzpuz · Pull Request #32085 · nodejs/node

Conversation

@puzpuzpuz

@puzpuzpuz puzpuzpuz commented Mar 4, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes the following issues within AsyncLocalStorage API:

  • Nested calls to run* were erasing the outer store, leading to context loss.
    • Note: test-async-local-storage-nested.js was updated to validate this fix, as its previous contents were a partial duplicate of test-async-local-storage-no-mix-contexts.js
  • Calls to exit* were switching enabled field to true without checking current value. This leads to incorrect behavior of further getStore and run* calls.

These issues were discussed in #31950, but as that PR involves significant changes in implementation and will require some time to settle down.

cc @vdeturckheim @Qard @Flarna

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss and vdeturckheim reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@nodejs-github-bot nodejs-github-bot added the async_hooks Issues and PRs related to the async hooks subsystem. label Mar 4, 2020
@puzpuzpuz
async_hooks: fix context loss after nested calls to AsyncLocalStorage
4c28a3d
@puzpuzpuz
puzpuzpuz force-pushed the async-local-storage-fix-nested-calls branch from 3caff2f to 4c28a3d Compare March 4, 2020 12:49
@puzpuzpuz puzpuzpuz mentioned this pull request Mar 4, 2020
async_hooks: prevent async storage methods leaking to outer context #31950
Closed
2 tasks done
Qard
Qard approved these changes Mar 5, 2020
View reviewed changes
vdeturckheim
vdeturckheim reviewed Mar 5, 2020
View reviewed changes
Comment thread lib/async_hooks.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

vdeturckheim
vdeturckheim approved these changes Mar 5, 2020
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Mar 5, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/29564/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vdeturckheim

vdeturckheim commented Mar 5, 2020

Copy link
Copy Markdown
Member

@puzpuzpuz I am afraid there is a curse on your PRs and CI 😝. I will resume this build 😉

puzpuzpuz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Mar 5, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/29566/

puzpuzpuz reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@puzpuzpuz

puzpuzpuz commented Mar 5, 2020

Copy link
Copy Markdown
Member Author

@puzpuzpuz I am afraid there is a curse on your PRs and CI 😝. I will resume this build 😉

I knew it. Sounds like the most logical reason for these permanently flaky builds. 🤣

Thanks for restarting it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@puzpuzpuz

puzpuzpuz commented Mar 5, 2020

Copy link
Copy Markdown
Member Author

Looks like the second attempt was successful. 🥳

vdeturckheim and Qard reacted with hooray emoji
All reactions
  • 🎉 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Qard Qard added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Mar 6, 2020
mhdawson
mhdawson approved these changes Mar 6, 2020
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mhdawson pushed a commit that referenced this pull request Mar 6, 2020
@puzpuzpuz @mhdawson
async_hooks: fix ctx loss after nested ALS calls
86ab4ee
PR-URL: #32085
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@mhdawson

mhdawson commented Mar 6, 2020

Copy link
Copy Markdown
Member

Landed in 86ab4ee

puzpuzpuz and Qard reacted with hooray emoji
All reactions
  • 🎉 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson mhdawson closed this Mar 6, 2020
@puzpuzpuz
puzpuzpuz deleted the async-local-storage-fix-nested-calls branch March 7, 2020 06:05
MylesBorins pushed a commit that referenced this pull request Mar 9, 2020
@puzpuzpuz @MylesBorins
async_hooks: fix ctx loss after nested ALS calls
3befe80
PR-URL: #32085
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 10, 2020
v13.11.0 proposal #32185
Merged
@codebytere

codebytere commented Mar 16, 2020

Copy link
Copy Markdown
Member

Blocked on #26540.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codebytere codebytere added the backport-blocked-v12.x label Mar 16, 2020
@puzpuzpuz puzpuzpuz mentioned this pull request Mar 17, 2020
[v12.x backport] async_hooks: add AsyncLocalStorage #32318
Closed
4 tasks done
@puzpuzpuz

puzpuzpuz commented Mar 17, 2020

Copy link
Copy Markdown
Member Author

v12 backport: #32318

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos targos added backported-to-v12.x and removed backport-blocked-v12.x labels Mar 17, 2020
puzpuzpuz added a commit to puzpuzpuz/node that referenced this pull request Apr 14, 2020
@puzpuzpuz
async_hooks: fix ctx loss after nested ALS calls
5036117
PR-URL: nodejs#32085
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@targos targos removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
@puzpuzpuz @targos
async_hooks: fix ctx loss after nested ALS calls
dc04ca4
PR-URL: nodejs#32085
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
@puzpuzpuz @targos
async_hooks: fix ctx loss after nested ALS calls
06d607d
PR-URL: #32085
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Vladimir de Turckheim <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@targos targos mentioned this pull request May 2, 2020
v12.17.0 release proposal #33197
Merged
@vmarchaud vmarchaud mentioned this pull request Jun 18, 2020
AsyncLocalStorage based ContextManager open-telemetry/opentelemetry-js#1210
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Qard Qard Qard approved these changes
+2 more reviewers
@vdeturckheim vdeturckheim vdeturckheim approved these changes
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

async_hooks Issues and PRs related to the async hooks subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@puzpuzpuz @nodejs-github-bot @vdeturckheim @mhdawson @codebytere @Qard @targos
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.