Skip to content

async_hooks: only disable promise hook if wanted

Rodrigo Muino Tomonari requested to merge github/fork/addaleax/fix-27585 into master

The promise hook has been disabled asynchronously in order to solve issues when an async hook is disabled during a microtask.

This means that after scheduling the disable-promise-hook call, attempts to enable it synchronously will later be unintentionally overridden.

In order to solve this, make sure that the promise hooks are still no longer desired at the time at which we would disable them.

Fixes: https://github.com/nodejs/node/issues/27585

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading