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 behavior of interrupt (SIGINT, SIGTERM) signals #769
Conversation
0d2ff26
to
7989f73
Compare
I took some time to understand the problem, but thanks to the We had code to intercept the signals and it triggered a cancel of the context, which means the process was actually receiving two signals: one because of the Lines 252 to 262 in c9a582f
Changed it so it will now only intercept the signal but don't cancel the context, so it's actually sent only once to the sub-processes as expected. As an addition, I added a force kill behavior if SIGINT is sent for the third time, so users at least have way to force Task to quit if any sub-process happen to be stuck. Also changed the timeout to send KILL to processes in case of context cancellation from 2 to 15 seconds, which give them more time to do the necessary cleanup. I'll merge it to master. Please give it a test if possible and let me know if it's working correctly. I'll wait a couple days to release it to be more certain that it is stable. |
This is what I remember I had discovered in my work, yes.
This looks correct to me. I will try to test it today. Thanks for the effort! |
Seems to be running fine. |
@marco-m-pix4d Great! I plan to make a release tonight. We still have that intermittently failing test as before. Hopefully we'll find a solution for that soon. |
Task will now give time for the processes running to do cleanup work
Ref #458
Ref #479
Fixes #728