-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
win, watchdog: add flag to mark handler as disabled #10248
Conversation
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock.
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.
LGTM with a suggestion
@@ -91,6 +91,7 @@ class SigintWatchdogHelper { | |||
static void* RunSigintWatchdog(void* arg); | |||
static void HandleSignal(int signum); | |||
#else | |||
bool watchdog_disabled_; |
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.
Tbh, I would find this a bit easier to read as watchdog_enabled_
with the logic flipped around
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.
It would be nicer, but with watchdog_disabled_
it is easier to tell if SigintWatchdogHelper::Start()
is called for the first time and we have to register the handler or it is called after ::Stop()
and we just have to flip the flag.
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock. PR-URL: #10248 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock. PR-URL: #10248 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock. PR-URL: #10248 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock. PR-URL: #10248 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock. PR-URL: #10248 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Adds flags that marks WinCtrlCHandlerRoutine as disabled instead of removing it. Trying to remove the controller from the controller handle itself leads to deadlock. PR-URL: #10248 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
win, watchdog
Description of change
When calling
process.exit
fromSIGHUP
handler current code tries to remove CTRL-C handler (WinCtrlCHandlerRoutine
) by callingSetConsoleCtrlHandler
. This however leads to deadlock, sinceSetConsoleCtrlHandler
blocks util all control handlers exits.This commit adds flags that marks
WinCtrlCHandlerRoutine
as disabled instead of removing it.When libuv/libuv#1168 lands, toogether it will fix #10165
cc: @addaleax @bnoordhuis