We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 129243a commit 4b83940Copy full SHA for 4b83940
1 file changed
tuf/ngclient/updater.py
@@ -92,8 +92,14 @@ def _lock_file(f: IO) -> None:
92
f.write(b"\0")
93
f.flush()
94
f.seek(0)
95
-
96
- msvcrt.locking(f.fileno(), msvcrt.LK_LOCK, 1)
+ # msvcrt.locking() only retries 9 times
+ while True:
97
+ try:
98
+ msvcrt.locking(f.fileno(), msvcrt.LK_LOCK, 1)
99
+ logger.warning("Got metadata lock")
100
+ return
101
+ except OSError as e:
102
+ logger.warning("Failed to get metadata lock, retrying: %s", e)
103
104
105
class Updater:
0 commit comments