-
Notifications
You must be signed in to change notification settings - Fork 4
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
Consider replacing fcntl with portalocker for Windows support #53
Comments
It's used for file locking in lib-cove/libcove/lib/common.py Lines 1241 to 1270 in 0bc725b
We could take a different approach to this, but I'm not quite sure how much work it would be. |
Why do we need to lock the file, though? In what scenario would there be simultaneous writes? |
This gets called from cove-ocds web requests, where we may have multiple processes/threads calling this function at once. |
Aha. Renamed issue and found this library that can perhaps be used to support multiple operating systems: https://pypi.org/project/portalocker/ |
My proposal for safely removing the file locking The 2 race conditions to account for are: Process A checks for the existence of the file finds none Process A checks for the existence of the file finds none In the first case we don't care because the data is never mutated and gathered from the same source. This wouldn't work in cases where data is mutated, but it does in ours. Also added tests |
Closed by #74 |
@Bjwebb You can close this issue to declutter issue tracker. |
It's not available on Windows.
The text was updated successfully, but these errors were encountered: