Skip to content

Commit 7369a78

Browse files
authored
chore: flush shared string file before unlocking (#15333)
## Description We make sure that writes to shared string files are flushed before the exclusive lock is released to guarantee that changes are visible to other processes trying to access the same file.
1 parent 2cc3c8b commit 7369a78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ddtrace/internal/ipc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,7 @@ def lock_exclusive(self):
181181
return
182182
with open_file(self.filename, "r+b") as f, WriteLock(f):
183183
yield f
184+
# Flush before releasing the lock. Here we first release the lock,
185+
# then close the file. If a read happens in between these two
186+
# operations, the reader might see outdated data.
187+
f.flush()

0 commit comments

Comments
 (0)