-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
kill tox process does not kill running commands #1772
Comments
This is a side effects of how sub processes work. If you kill the tox process there's no way you can stop the subprocess. There's no way to mark a subprocess daemon to die with the parent. |
@gaborbernat you are right, it is not the "natural" way of handling a parent process being killed. And if it were a SIGKILL signal there would be nothing to be done. A import signal
signal.signal(signal.SIGTERM, signal.getsignal(signal.SIGINT))
from subprocess import run
run(['python3', 'papa.py']) That code above is not my best work, but it takes a SIGTERM and make the parent process handle as it was a Ctrl+C. Which would in turn kill the children. I wonder if we can reopen the issue, calling it a bug was my mistake. It is most likely an enhance request. |
I forgot to mention, I found this while debugging an issue presented while running tox in a Jenkins instance... it seems that jenkins sends a SIGTERM on a job abort (jenkinsci/jenkins#3414)... and my tox commands are continuing to run after the abort. |
Tox seems to not being sending the sigterm signal back to the subprocess it is driving.
This can be reproduced with this configuration, and killing the tox process.
tox.ini
papa.py
from a terminal run
and on another, search the process and kill it, for example:
The first terminal will keep showing the prints :(
The text was updated successfully, but these errors were encountered: