-
-
Notifications
You must be signed in to change notification settings - Fork 711
fix: Handle SIGTERM more gracefully in watchmedo #693
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
fix: Handle SIGTERM more gracefully in watchmedo #693
Conversation
Hello @maybe-sybr, Thanks for the patch 💪 |
It sounds very similar but I think my change would only fix the behaviour for repeated SIGTERMs and repeated SIGINTs would still misbehave, The Having looked through this a bit more, I think my diff is somewhat incomplete anyway. By not pivoting to using the semantic exception everywhere, the behaviour is inconsistent and as an example, the observer thread is not stopped as expected since we no longer raise the expected |
a2767ae
to
6c0dce3
Compare
@BoboTiG - the new diff fixes #543 from what I can tell. I've only sanity tested it manually on Linux but IIUC since we're limitiing ourselves to catching TERM and INT, it should work fine on Windows. I've also made a small doco change to discourage just catching |
6c0dce3
to
c762eab
Compare
Thanks a lot, that's perfect! May I ask you to update the changelog + add youself to the line about our beloved contributors? |
This fixes misbehaviour where the child process could be orphaned if watchmedo received multiple non-fatal signals causing the `handler.stop()` call to be interrupted or never occur. By raising a semantic exception after neutering the relevant signals, we give ourselves a better chance of killing the child. Fixes gorakhargosh#543
This should encourage better handling of non-^C exit conditions in API based use.
c762eab
to
9c0dfb9
Compare
Done, @BoboTiG - lmk if you need anything else from me. And thanks for being so responsive! |
Thank you for yours :) |
This fixes some misbehaviour where the child process could be orphaned
if watchmedo received multiple SIGTERMs causing the
stop()
call to beinterrupted. By raising a semantic exception after neutering the signal
handler, we give ourselves a better chance of killing the child.