-
Notifications
You must be signed in to change notification settings - Fork 257
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 signal command and stopping procedure #603
Fix signal command and stopping procedure #603
Conversation
Hmm, going to make sending stop_signal to the children optional... Please hold. |
…ends to parent first and then all children Previously, if a single child was already dead, the code would have given up
Done. Previous 'kill' logic had a pretty serious flaw. It iterated through the children first, sending each the stop command, then killed the parent. If any process was already dead, the entire method returned. So if a single child had already died, the kill would never have gotten sent to the parent. Also, 2 more points. For many apps, you do not want to send the initial stop signal to the children. The parent is expected to cleanly shut down its children when it gets the stop command. So I added a 'stop_children' parameter that defaults to false. Secondly, when we have to issue a SIGKILL, we need to kill the parent first so that it doesn't start respawning children. |
I understand that changing kill logic is a bit risky, but I'm pretty certain that this version is more correct. However, it is possible that people have circus in production today with apps that expect the kill signal to be sent to all children. Those children would still get shutdown since the SIGKILL always does children, but they would not have the opportunity to shutdown gracefully. So an argument could be made for having 'stop_children' default to true. But if this is not a large concern, I think defaulting to false is usually more correct. |
Ouch :/ - I suspect we need to make sure this is covered by a test. |
Need to fix Py3. :-) Just a minute. |
…t variable isn't explicitly set. Travis needs more time.
Travis needs more time... |
OK, changing default to 10 seconds for ASYNC_TEST_TIMEOUT allowed a clean run through Travis. This should be good to go. |
Great job thanks a lot |
Fix signal command and stopping procedure
The signal command was fairly broken, especially from the command line. Sending a signal to all processes of a watcher call watcher.send_signal_processes(), which does not exist. The recursive and children flags defaulted to true, contrary to the docs. The command-line took an unused 'process' parameter. And children and recursive flags were only used with the 3 argument version of the command-line.