-
Notifications
You must be signed in to change notification settings - Fork 372
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
Clean up signal handling and sentinel file #1188
Conversation
@@ -382,7 +378,6 @@ def _emit_restart_event(self): | |||
except Exception: | |||
pass | |||
|
|||
self._set_sentinal(msg="Starting") |
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.
Removing this is the primary fix here.
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.
How often is SIGKILL a problem? I strongly suspect some other signal is clobbering the agent (SIGSEGV and the like) rather than the uncatchable SIGKILL. Will this change mean you no longer detect when the agent dies due to some other signal?
# A SIGKILL handler is not being registered at this time to | ||
# minimize perturbing the code. | ||
if signum in (signal.SIGTERM, signal.SIGKILL): | ||
if signum == signal.SIGTERM: |
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.
Dh you want to catch SIGQUIT as well?
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.
I thought SIGQUIT was a keyboard signal?
All we really do in the signal handler is clean up the sentinel and child processes, but we also do a cleanup on restart. So I think the value is purely in knowing 'something other than SIGTERM killed me', which is not actionable or imo very useful. I am going to merge, but happy to discuss further. |
SIGTERM
from the default handler we should callshutdown()
SIGKILL
cannot be caught, and we consider this to be a clean shutdown; instead only emit a sentinel on an unhandled error