FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

async_hooks: fix context loss after nested calls to AsyncLocalStorage by puzpuzpuz · Pull Request #32085 · nodejs/node · GitHub

/ node Public

async_hooks: fix context loss after nested calls to AsyncLocalStorage - #32085

Closed
puzpuzpuz wants to merge 1 commit into
nodejs:masterfrom
puzpuzpuz:async-local-storage-fix-nested-calls
Closed

async_hooks: fix context loss after nested calls to AsyncLocalStorage#32085
puzpuzpuz wants to merge 1 commit into
nodejs:masterfrom
puzpuzpuz:async-local-storage-fix-nested-calls

Conversation

puzpuzpuz commented Mar 4, 2020
edited
Loading

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

nodejs-github-bot added the async_hooks Issues and PRs related to the async hooks subsystem. label Mar 4, 2020
Comment thread lib/async_hooks.js

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Collaborator

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

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.

Copy link
Copy Markdown
Member Author

Looks like the second attempt was successful. 🥳

Qard added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 6, 2020

mhdawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

mhdawson pushed a commit that referenced this pull request Mar 6, 2020
PR-URL: #32085
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

mhdawson commented Mar 6, 2020

Copy link
Copy Markdown
Member

Landed in 86ab4ee

mhdawson closed this Mar 6, 2020
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
PR-URL: #32085
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins mentioned this pull request Mar 10, 2020

Copy link
Copy Markdown
Member

Blocked on #26540.

Copy link
Copy Markdown
Member Author

v12 backport: #32318

puzpuzpuz added a commit to puzpuzpuz/node that referenced this pull request Apr 14, 2020
PR-URL: nodejs#32085
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
targos removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
PR-URL: nodejs#32085
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
targos pushed a commit that referenced this pull request Apr 28, 2020
PR-URL: #32085
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooks Issues and PRs related to the async hooks subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL