-
Notifications
You must be signed in to change notification settings - Fork 44
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
InterProcessLock does not lock #116
Comments
Is this related to fasteners? The title of the issue mentions InterProcessLock, but your snippet does not use InterProcessLock or any other fasteners functions. Can you please make a small example which illustrates deficiency of fasteners library? Also, one thing of note, some interprocess locks do not work with threads. If you are looking for a process lock, test it with multiple processes, not multiple threads. |
@psarka thanks for quick reply! I'm sorry that I didn't provide enough information, external_lock from lockutils uses InterProcessLock [0] from fasteners. And it seems InterProcessLock is not thread safe which I discovered later [1]. Do you think adding docstrings to both fasteners and oslo.concurrency that will highlight this info will be useful? [0] https://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L208 |
It seems that flock and lockf works differently, and lockf does lock file as expected.
There is test code I'm using
And it produce following output on Ubuntu 22.04 and on macOS
Which basically shows that lockutils.external_lock and test_fcnl_lockf does not lock on file as expected. Please help to fix this issue.
The text was updated successfully, but these errors were encountered: