-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasi,worker: handle termination exception #33386
Conversation
@bnoordhuis are you still planning to work on this? I'm willing to implement #33386 (comment) if you'd like. |
It obscures the fact that there is only a single BeforeExit action. Just call that statically from `EmitBeforeExit()`.
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: nodejs#33377
@@ -30,15 +30,21 @@ void AtExit(Environment* env, void (*cb)(void* arg), void* arg) { | |||
} | |||
|
|||
void EmitBeforeExit(Environment* env) { | |||
env->RunBeforeExitCallbacks(); | |||
TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | |||
"BeforeExit", env); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the lifetime of the scope a little but makes it more correct, IMO. In the old location it only covered part of the BeforeExit sequence.
Landed in a3f47b1...d85a933 🎉 |
It obscures the fact that there is only a single BeforeExit action. Just call that statically from `EmitBeforeExit()`. PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
It obscures the fact that there is only a single BeforeExit action. Just call that statically from `EmitBeforeExit()`. PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
It obscures the fact that there is only a single BeforeExit action. Just call that statically from `EmitBeforeExit()`. PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
It obscures the fact that there is only a single BeforeExit action. Just call that statically from `EmitBeforeExit()`. PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
It obscures the fact that there is only a single BeforeExit action. Just call that statically from `EmitBeforeExit()`. PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Fixes: #33377