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
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()
. https://github.com/bit-team/backintime/blob/4d7e920afe18e767a8999cb0752b972b86d5772e/common/snapshots.py#L784Solution: My proposed solution is to add a new argument to
GlobalFlock()
context manager to disable it based on the config valueglobal.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:I'll combine the solution together with Issue #1743