You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If two processes are racing to make the same final file:
rename /run/notifydedup/counter.json.part /run/notifydedup/counter.json: no such file or directory; also failed removing temp file: remove /run/notifydedup/counter.json.part: no such file or directory
Think timeline:
Process 1 starts producing counter.json.part
Process 2 starts producing counter.json.part, overriding first one
Process 1 renames the part file to target (thinking it is its own part file), effectively replacing the target file with an incomplete file
Is it possible to use locking with the part file in a way that two competing processes are not racing to produce the target file?
The text was updated successfully, but these errors were encountered:
The above fix mitigates this, but leaving open to consider:
Testing of this fix
Should we use file locking on the partial file, so if a dangling file was left by a crashed process, we know that if we get a lock we know we can "regain ownership" of the partial file. NOTE: make sure file is truncated, so we don't build on top of garbage
Currently a dangling file prevents atomic file write from working at all
If two processes are racing to make the same final file:
Think timeline:
counter.json.part
counter.json.part
, overriding first oneIs it possible to use locking with the part file in a way that two competing processes are not racing to produce the target file?
The text was updated successfully, but these errors were encountered: