diff options
author | Stephen Belanger <stephen.belanger@datadoghq.com> | 2021-06-03 08:22:15 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-06-11 08:24:55 +0300 |
commit | 03e75fda4cf1de0664c3110190886e684ece20bc (patch) | |
tree | bbabbb49acc1e252ebed61a798dc7ce272525e2c /lib | |
parent | 74f5e30d692e9559ee2d7521c9feddf55f941cc7 (diff) |
async_hooks: switch between native and context hooks correctly
:facepalm: Might help if I remember to disable the _other_ promise
hook implementation when switching between them...
Fixes #38814
Fixes #38815
Refs #36394
PR-URL: https://github.com/nodejs/node/pull/38912
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/async_hooks.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index eac2471ff79..a6d258cf257 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -357,7 +357,9 @@ function updatePromiseHookMode() { wantPromiseHook = true; if (destroyHooksExist()) { enablePromiseHook(); + setPromiseHooks(undefined, undefined, undefined, undefined); } else { + disablePromiseHook(); setPromiseHooks( initHooksExist() ? promiseInitHook : undefined, promiseBeforeHook, |