Closed
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.