Skip to content

Commit 23eafea

Browse files
authored
paths: fdatasync PidFile (#4890)
We do want to know the pid of the process holding the lock, so the information should be durable. # Expected complexity level and risk 1
1 parent 2063a93 commit 23eafea

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

crates/paths/src/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ impl ServerDataDir {
4949
pidfile.file.set_len(0)?;
5050
write!(pidfile.file, "{}", std::process::id())?;
5151
pidfile.file.flush()?;
52+
pidfile.file.sync_data()?;
53+
5254
Ok(pidfile)
5355
}
5456

0 commit comments

Comments
 (0)