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

Thread safety of get_lock in asyn.py #1783

Open
ccotter opened this issue Jan 28, 2025 · 1 comment
Open

Thread safety of get_lock in asyn.py #1783

ccotter opened this issue Jan 28, 2025 · 1 comment

Comments

@ccotter
Copy link

ccotter commented Jan 28, 2025

https://github.com/fsspec/filesystem_spec/blob/master/fsspec/asyn.py#L27-L35

If _lock is None, if two threads both enter get_lock, both threads could see _lock is None, one thread could create a new Lock, return it to the caller, then the second thread could create a new Lock and return that different lock to the caller.

@martindurant
Copy link
Member

Would be happy to see a solution

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

2 participants