async_hooks: execute destroy hooks earlier · nodejs/node@95e0f8e · GitHub
Skip to content

Commit 95e0f8e

Browse files
Flarnaaddaleax
authored andcommitted
async_hooks: execute destroy hooks earlier
Use a microtask to call destroy hooks in case there are a lot queued as immediate may be scheduled late in case of long running promise chains. Queuing a mircrotasks in GC context is not allowed therefore an interrupt is triggered to do this in JS context as fast as possible. fixes: #34328 refs: #33896 PR-URL: #34342 Fixes: #34328 Refs: #33896 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 059db05 commit 95e0f8e

2 files changed

Lines changed: 109 additions & 0 deletions

File tree

src/async_wrap.cc

Lines changed: 12 additions & 0 deletions
Lines changed: 97 additions & 0 deletions

0 commit comments

Comments
 (0)