You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Late enabling of async_hooks after promise creation causes process abort #13237
But the above solution is more consistent when .disable() is called after .enable(). Perhaps, more importantly, it highlights an issue where the promise is created just before the hooks are setup. In which case the node process will currently abort because of CHECK_NE(wrap, nullptr);.
I don't think there is a good solution to this problem. But I would like to another opinion on that.
Otherwise, we will just have to check for the env->promise_wrap() property and not emit before, after and destroy in this case. This is a difference behavior than that for all other *Wrap types, which is why it is not a good solution.
Could we create a new PromiseWrap if there wasn't one already?
Ack, I think this is a better solution, at least as long as we don’t have metrics on how expensive enabling a PromiseHook actually is; I can’t really imagine that it’s close to having no overhead. I’ll open a PR shortly.
Activity
Fishrock123 commentedon May 26, 2017
Could we create a new
PromiseWrapif there wasn't one already?addaleax commentedon May 26, 2017
Ack, I think this is a better solution, at least as long as we don’t have metrics on how expensive enabling a
PromiseHookactually is; I can’t really imagine that it’s close to having no overhead. I’ll open a PR shortly.AndreasMadsen commentedon May 26, 2017
Sounds good. But we will have to make sure the
inithooks isn't fired upon creation only inPromiseHookType::kInit.addaleax commentedon May 26, 2017
Done in #13242 :)
async_hooks: fix Promises with later enabled hooks
async_wrap: fix Promises with later enabled hooks
async_wrap: fix Promises with later enabled hooks