-
Notifications
You must be signed in to change notification settings - Fork 9
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
regolancer.lock not deleted #44
Comments
See gofrs/flock#41. I suppose it's unsafe to delete lock files in general if we expect many processes to run in parallel. Consider this situation:
And here we have process2 and process3 using the "exclusive" lock together at the same time. |
But this means, that I have to delete the lock by myself before starting a new run? Otherwise, I think, no process can write in the db. |
Have you tried just running the program? I never deleted the lock and it all worked fine even when I ran 3-4 processes at once. The mere presence of that file doesn't mean it's locked, Oh, and also we don't have a db except the optional CSV stat file. It's currently not protected by the lock but it will be soon. If you mean the node cache, it's also not a db but a |
The program seems to work. But sometimes there is a difference between what you see and what happens. |
It's a technicality, there's no way in the library we use to delete that file and I showed why it's not a good idea in our case. If you're supposed to run exactly one instance of software and it holds the lock during the entire run time then I think it might be deleted safely on exit. But people run multiple regolancer instances, up to 40 in parallel, so deleting the lock might cause unexpected race conditions this lock should prevent exactly. |
I am experimenting with multiple reglancer sessions. I have realized that after a full run the regolancer.lock still exists. I guess that's not the correct behaviour.
The text was updated successfully, but these errors were encountered: