Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: 1f46cb4b604abb8cf3bc5610143ff004d7bc75de
https://github.com/Checkmk/checkmk/commit/1f46cb4b604abb8cf3bc5610143ff004d…
Author: Sergey Kipnis <sergey.kipnis(a)checkmk.com>
Date: 2023-05-26 (Fri, 26 May 2023)
Changed paths:
M cmk/utils/store/_file.py
M cmk/utils/store/_locks.py
M tests/unit/cmk/utils/test_store.py
Log Message:
-----------
fix recursive file locking
locked() API guaranties now the file will be locked till the top-most
context manager exits.
This CL fixes next problem:
```
with locked("a"):
with locked("a"):
...
# here file "a" is unlocked
Path("a").write("very important data")
```
Tests are extended to check above mentioned pattern.
Some minor improvements(removed duplicated tests)
Change-Id: Ife9c133def2eae98a332b5ad1c800711e24e7726