-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Getting FileExistsError occasionally #56
Comments
I'm just trying out the filelock module myself. In your function, what happens if a file that would have triggered the check that raises |
The function halts after the raise, so wherever that problematic locked_file was called will fail as well. |
Looking at the code, in |
Hello, if you make a PR for this (with tests) we would be happy to review it, thanks! |
I use this function in several different scripts in a project:
A little background, this is used on a project that several use on several different machines that share a filesystem. There are also cron jobs running scripts that use locked_file, and subprocesses are sometimes spawned off that use locked_file. Not sure if any of this is relevant, just putting it out there.
Relatively frequently, users get an error that indicates the lock already exists, but it doesn't wait the 10 second timeout seeing if it can acquire the lock it just throws the following exception. Any idea why?
The error goes away upon re-running whatever program originally broke, but it's very frustrating.
In terms of debugging this, I can't reliably reproduce it. I tried writing a script that sleeps for 10 seconds in
with
block and running it simultaneously from two different machines, but it worked as expected consistently.The text was updated successfully, but these errors were encountered: