async_hooks: only emit `after` for AsyncResource if stack not empty · nodejs/node@56be32d · GitHub
Skip to content

Commit 56be32d

Browse files
addaleaxtargos
authored andcommitted
async_hooks: only emit after for AsyncResource if stack not empty
We clear the async id stack inside the uncaught exception handler and emit `after` events in the process, so we should not emit `after` a second time from the `runInAsyncScope()` code. This should match the behaviour we have in C++. Fixes: #30080 PR-URL: #30087 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
1 parent ee3c3ad commit 56be32d

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

lib/async_hooks.js

Lines changed: 3 additions & 1 deletion
Lines changed: 36 additions & 0 deletions

0 commit comments

Comments
 (0)