async_hooks: fix id assignment in fast-path promise hook · nodejs/node@e9aebc3 · GitHub
Skip to content

Commit e9aebc3

Browse files
puzpuzpuzcodebytere
authored andcommitted
async_hooks: fix id assignment in fast-path promise hook
Native side of fast-path promise hook was not calling JS fastPromiseHook function when there were no async ids previously assigned to the promise. Because of that already created promises could not get id assigned in situations when an async hook without a before listener function is enabled after their creation. As the result executionAsyncId could return wrong id when called within promise's .then(). Refs: #34512 PR-URL: #34548 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
1 parent bd55236 commit e9aebc3

2 files changed

Lines changed: 69 additions & 38 deletions

File tree

src/async_wrap.cc

Lines changed: 44 additions & 38 deletions
Lines changed: 25 additions & 0 deletions

0 commit comments

Comments
 (0)