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
If the threadpool worker ran a task that initialized a hub, because after the fork the thread is dead and we try to destroy from a different thread. This is a bit of a regression introduced by #1601
Traceback (most recent call last): File "//gunicorn-19.9.0-py2.7.egg/gunicorn/arbiter.py", line 203, in run self.manage_workers() File "//gunicorn-19.9.0-py2.7.egg/gunicorn/arbiter.py", line 545, in manage_workers self.spawn_workers() File "//gunicorn-19.9.0-py2.7.egg/gunicorn/arbiter.py", line 616, in spawn_workers self.spawn_worker() File "//gunicorn-19.9.0-py2.7.egg/gunicorn/arbiter.py", line 567, in spawn_worker pid = os.fork() File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/os.py", line 476, in fork return fork_and_watch(*args, **kwargs) File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/os.py", line 431, in fork_and_watch pid = fork() File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/os.py", line 198, in fork_gevent reinit() File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/hub.py", line 357, in reinit getattr(obj, '_on_fork', lambda: None)() File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/threadpool.py", line 384, in _on_fork worker.cleanup(worker._hub_of_worker) File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/threadpool.py", line 194, in cleanup hub_of_worker.destroy(True) File "//gevent-20.5.1-py2.7-linux-x86_64.egg/gevent/hub.py", line 787, in destroy self.throw(GreenletExit) error: cannot switch to a different thread
The text was updated successfully, but these errors were encountered:
Catch greenlet.error when destroying a hub from another thread.
10d0551
Fixes #1631
Successfully merging a pull request may close this issue.
If the threadpool worker ran a task that initialized a hub, because after the fork the thread is dead and we try to destroy from a different thread. This is a bit of a regression introduced by #1601
The text was updated successfully, but these errors were encountered: