Skip to content
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

resource tracker dies due to unsafe late-forking? #1355

Open
srepmub opened this issue Aug 22, 2022 · 0 comments
Open

resource tracker dies due to unsafe late-forking? #1355

srepmub opened this issue Aug 22, 2022 · 0 comments

Comments

@srepmub
Copy link

srepmub commented Aug 22, 2022

tqdm triggers multiprocessing.resource_tracker to fork off in tqdm.create_mp_lock. and forking is unsafe for multi-threaded programs (when not using forkserver/spawn start methods). we very reliably get this under OSX for our multi-hreaded program:

"/python3.10/multiprocessing/resource_tracker.py:105: UserWarning: resource_tracker: process died unexpectedly, relaunching. Some resources might leak."

we tried to use set_start_method('forkserver'), but for some reason this led to the same error. so we now add this at import time to our code:

import tqdm
from multiprocessing import RLock
RLock()

which seems to work around the problem for us.. of course it would be nicer if tqdm could fix/work around the issue itself..? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant