-
Notifications
You must be signed in to change notification settings - Fork 938
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
os.popen in gunicorn ggevent worker class encounter "IOError: [Errno 10] No child processes" #696
Comments
Can you reproduce this without any third-party dependencies? Based on your description, I would expect to be able to produce this with a simple use of Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gevent.monkey
>>> gevent.monkey.patch_all()
>>> import gevent
>>> gevent.__version__
'1.1rc1'
>>> import ctypes.util
>>> ctypes.util.find_library('X11')
'libX11.so.6'
>>> import os
>>> f = os.popen('type gcc')
>>> f.read()
'gcc is /usr/bin/gcc\n'
>>> f.close()
>>> os.fork.func_code # prove we're patched
<code object fork at 0x7faf91c57cb0, file "/.../gevent/local/lib/python2.7/site-packages/gevent/os.py", line 372> |
ok, I 'll try to figure out how to reproduce without only gevent. |
This program produces the error without using gevent at all: import os
import signal
def handle(*args):
os.waitpid(-1, os.WNOHANG)
signal.signal(signal.SIGCHLD, handle)
pid = os.fork()
if pid: # parent
os.waitpid(-1, 0)
else: # child
import ctypes.util
print ctypes.util.find_library('X11')
That is, if any SIGCHLD handler is installed that does a global Gunicorn's Arbiter (master) process installs a SIGCHLD handler that ultimately does exactly this. Workers try to reset this to SIG_DFL, but usage of the |
This issue was introduced in v1.1b4. (not present in v1.1b3)
How to reproduce:
gunicorn -k gevent test_dll2:app
The text was updated successfully, but these errors were encountered: