Intermittent File locking collisions
Discussions on Python.org
Intermittent File locking collisions
Greetings In trying to track down the cause of some file corruption in a shared filesystem (AWS EFS), I have discovered some strange behaviour. I have used the following setup to execute to processes trying to take a filelock on the same file at the same time: import fcntl import struct import sys import time with open("test_file.lock", "w+") as f: fd = f.fileno() exitcode = 0 try: fcntl.fcntl(fd, fcntl.F_SETLK, struct.pack("hhqqi", 1, 0, 0, 0, 0)) except OSError as e...
0 comments
No comments yet.