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
gevent
gets stuck when gevent.threadpool
is used inside a fork hook
#2023
Comments
sumerc
changed the title
gevent stuck when
Feb 20, 2024
gevent.threadpool
is used inside a fork hookgevent
subprocess.POpen
gets stuck when gevent.threadpool
is used inside a fork hook
sumerc
changed the title
Feb 20, 2024
gevent
subprocess.POpen
gets stuck when gevent.threadpool
is used inside a fork hookgevent
gets stuck when gevent.threadpool
is used inside a fork hook
I can see the same thing with import gevent.monkey
gevent.monkey.patch_all(thread=True)
def tttqqqdddmmm():
import tqdm
def do_it():
for i in tqdm.tqdm(range(5)):
print(i)
global_threadpool = gevent.get_hub().threadpool
global_threadpool.spawn(do_it).get()
exit("tqdm_exit")
tttqqqdddmmm() Output:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
subprocess.Popen
gets stuck inside the fork hook ifgevent.threadpool
is used. The weird thing is if theprint(gevent.threadpool)
line is removed, issue does not happen.Reproducer
print(gevent.get_hub().threadpool, " >>> HUB.threadpool before hook")
is there. Somehow, reading threadpool before the fork hook causes the problem.3.10
works just fine.The text was updated successfully, but these errors were encountered: