-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Add option to delay propegating SIGINT to child process #1588
Conversation
The interrupt_timeout and terminate_timeout options are set on the environment, not globally.
6c56a2b
to
c03f2ae
Compare
@@ -160,22 +160,6 @@ Global settings are defined under the ``tox`` section as: | |||
Name of the virtual environment used to create a source distribution from the | |||
source tree. | |||
|
|||
.. conf:: interrupt_timeout ^ float ^ 0.3 |
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.
Why move these?
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.
This PR bundles up two commits. I can separate them out if needed, but it is explained in the earlier message:
Move timeout config options into correct section
The interrupt_timeout and terminate_timeout options are set on the
environment, not globally.
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'll update the PR message at least)
This requires a patch in tox that is currently WIP tox-dev/tox#1588
So the failing test ( |
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.
Sorry can't investigate this myself at the moment, and until the tests are passing we can't go ahead with this. Tets are passing on master.
Are the master tests consistently passing? |
Almost always. |
I'm confused. The docs suggest that tox already supports something like this. interrupt_timeout, terminate_timeout. Is that not what's being asked for? |
The problem is that Ctrl+C will send a SIGINT to the foreground processes. This means that tox receives it along with pytest (or whatever it may be). Because tox then sends a SIGINT to the child processes it receives it twice. This goes unnoticed in most cases, but it often means that while pytest is cleaning up it receives another SIGINT and then aborts the cleanup. This patch gives the running process a chance to exit before sending a SIGINT. If it hasn't exited, it'll receive a SIGINT from tox (which may be the first one it has received, or the second). |
Fixes tox-dev#1497 Ctrl+C sends a SIGTERM to both Tox and the running process, causing the running process to receive the signal twice once tox passes it along. This can often cancel or interfer with the process's cleanup. Instead, add an option to allow a process to suicide before sending the SIGTERM. Co-Authored-By: Stefan H. Holek <stefan@epy.co.at>
So I've set the default suicide timeout to 0. This ensures that the behaviour has not changed from previously, and that programs get (at least one) SIGINT immediately. This also fixes the flaky test that appear to be sensitive to timing. |
Co-Authored-By: Stefan H. Holek <stefan@epy.co.at> Co-authored-by: Stefan H. Holek <stefan@epy.co.at>
Fixes #1497
Ctrl+C sends a SIGTERM to both tox and the running process, causing the
running process to receive the signal twice once tox passes it along.
This can often cancel or interfer with the process's cleanup.
Instead, add an option to allow a process to suicide before sending the
SIGTERM.
Co-Authored-By: Stefan H. Holek stefan@epy.co.at
Also includes a minor fix for correcting the location of the documentation for the existing timeout options: The interrupt_timeout and terminate_timeout options are set on the environment, not globally.
Contribution checklist:
<issue number>.<type>.rst
for example (588.bugfix.rst)<type>
is must be one ofbugfix
,feature
,deprecation
,breaking
,doc
,misc
<your username>
"superuser
."CONTRIBUTORS
(preserving alphabetical order)