-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Closed
Copy link
Labels
async_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.
Description
- Version: v12.0.0
- Platform: macOS 10.14.3 (likely irrelevant)
- Subsystem: async_hooks
If I create an async hook and then disable it, then async ID tracking no longer works, even if subsequent async hooks are created and enabled, or if the first async hook is re-enabled.
Repro:
const ah = require('async_hooks');
// switch the order of these two lines, and things appear to work correctly
ah.createHook({ init: () => {} }).enable().disable().enable();
ah.createHook({ init: () => {} }).enable();
async function main() {
console.log(ah.executionAsyncId()); // should print 1
await 0;
console.log(ah.executionAsyncId()); // should print 7, but prints 1
}
main();
This appears to affect all of v12+ so far.
Metadata
Metadata
Assignees
Labels
async_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.