-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
unblock the wait loop under python 3.5 #1257
Conversation
in python 3.5 the select is blocking when waiting for it which prevent quick exit on SIGTERM. The problem is described: https://www.python.org/dev/peps/pep-0475/#backward-compatibility This change fix it by listening for signal event on the worker pipe. Once an event is triggered it will forcefully wake up the select and return. fix #1256
In python 3.6 this bug appeared again |
@aolefira how do you produce it? |
I run script ./stop.sh with next content: |
how can I rrepoduce it? Do you have any log?
…On Fri, Sep 29, 2017 at 8:40 AM, aolefira ***@***.***> wrote:
I run script ./stop.sh with next content:
kill cat gunicorn.pid
and waiting a lot of seconds until gunicorn processes will be killed.
Software:
gunicorn 19.7.1
python 3.6.0
ubuntu 16.04.1 LTS
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1257 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA4ol3Xqf2dSoZXo31EYmfTsDIcOF8xks5snJDEgaJpZM4Iaz4k>
.
|
There are no records in logs while shutting down. Command for start: [server:main] part of pyramid.ini: Any pyramid project should be used. To reproduce bug just enter: |
I cannot reproduce this. MacOS X 10.13 Do you have a long connection open when you do this? What happens if you use |
There are no long connections. |
Yes, on my macbook with MacOS X 10.11.6 this issue not reproduced too. |
This bug reproduce (on Ubuntu 16.04.1) even if there are no connections. |
Problem is that pyramid runs thread at startup. In mac os x that thread die immediately on app shutdown but in ubuntu it's waiting for some time |
setDaemon(True) for threads resolve this problem |
What thread does Pyramid run at startup? I'm not aware of it doing that. |
As far as I know, the only thread Pyramid starts are started by |
It's project specific threads. Two custom threads. First - scheduler and second - mailer. |
pserve is good for development. but for production its better to use something more advanced, like gunicorn https://docs.pylonsproject.org/projects/pyramid-cookbook/en/latest/deployment/gunicorn.html |
Also experiencing this bug on Ubuntu 16.04 / Python 3.5.2 / Gunicorn 19.7.1 |
unblock the wait loop under python 3.5
in python 3.5 the select is blocking when waiting for it which prevent quick
exit on SIGTERM.
The problem is described:
https://www.python.org/dev/peps/pep-0475/#backward-compatibility
This change fix it by listening for signal event on the worker pipe. Once an
event is triggered it will forcefully wake up the select and return.
fix #1256