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

Global flock active by default (but shouldn't) #1751

Closed
buhtz opened this issue Jun 5, 2024 · 0 comments · Fixed by #1756
Closed

Global flock active by default (but shouldn't) #1751

buhtz opened this issue Jun 5, 2024 · 0 comments · Fixed by #1756
Assignees

Comments

@buhtz
Copy link
Member

buhtz commented Jun 5, 2024

Context: Bug was introduce by me with PR #1697 providing a new GlobalFlock context manager.

Problem: The check of the config value global.use_flock is gone. So all user will have an activate global flock no matter of the configuration.

Before PR #1697 that global flock was disabled by default config. That config value was queried in a method named flockExclusive().

# self.flockExclusive()

Solution:
My proposed solution is to add a new argument to GlobalFlock() context manager to disable it based on the config value global.use_flock.
That is not elegant but there is a structure problem with the code in snapshots.py using that context manager. The code block handled by the context manager has hundred of lines of code. Because of that I can not do something like this:

if cfg.globalFlock():
    with flock.GlobalFlock():
        do_the_magic()
else:
    do_the_magic()

I'll combine the solution together with Issue #1743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant