You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 kill by default sends a SIGTERM, and that you can capture on python using signal. For example (using the same papa.py script above)
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: