-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
When receiving a SIGTERM supervisors should terminate their processes before joining them #1069
Conversation
… before joining them
ok I tested the PR and as I expected it it doesnt fix it |
@euri10 What environment are you running out of interest? I'm running on Ubuntu 20.04 I just tried this and it worked for me with the PR and didn't work without it: Without:
Nothing happens and had to close with CTRL-C With:
Would be interested to see if this is down to different environments handling signals differently. I also tested spinning up a docker container and using |
this is weird, I'm on debian |
I will try and spin up a fresh debian environment today to see if there's any strangeness in my setup that I've missed |
we'd also need to test the behaviour with gunicorn |
I've started looking at testing it with gunicorn as well, but as far as I can find the majority of the documentation suggests that gunicorn takes the place of the supervisors in this case, as it's suggested to run it with We're entering into areas that I don't have any knowledge of beyond scanning the code though, so if there are specific deployment scenarios where gunicorn uses either of the supervisors I'm more than happy to preemptively check them out in case there are any issues! |
I found this MR due to an issue with I installed this branch and this change solved my issue. I'm on MacOS 11.4 (Big Sur). Poetry Dependencies
Result: Command in the script that's run: This seems to reliably shut down the python processes, but I do see that Hope this helps as I'd l really like to see this resolved soon. Let me know if I can help with any other testing. Thanks! |
ok this is interesting @gmeans , it seems like a mac os thing, but not sure, I was not able to reproduce on linux, can you try reproduce with |
seems like I can reproduce in this draft PR, so at least I've got an idea of what's going on |
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.
let's roll with this, we can still see the macos "issue" after if needed, as this PR alone seems to solves the aforementionned issue ! thanks @sgsabbage
!!! When might I be able to see this released on PyPI? |
@sgsabbage I believe that this implementation was faulty... the More info: https://stackoverflow.com/a/31907519/2599133 Here's an example of what happens:
Now...
|
More on #1165 |
… before joining them (encode#1069)
Fixes #852
By calling
process.terminate()
, it sends a SIGTERM to the child processes which should handle it appropriately. That said, I have a very naive understanding of multiprocessing so this may not be the right resolution.