From b478ed747a50e907fb531dc02dfc3ee18177aa1c Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Wed, 25 Nov 2020 18:00:05 +0900 Subject: [PATCH] Attempt to fix bug surfacing sometimes in test. Recently, `test_index_manual_policy_mmap` has been failing on Windows. The idea addressed by this patch is that we forget to sync the parent directory with the current implementation of atomic writes. This was done correctly when we were relying the atomicwrites crate. *crossing fingers* --- src/directory/mmap_directory.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/directory/mmap_directory.rs b/src/directory/mmap_directory.rs index 122a366d8..184795d9e 100644 --- a/src/directory/mmap_directory.rs +++ b/src/directory/mmap_directory.rs @@ -449,7 +449,8 @@ impl Directory for MmapDirectory { fn atomic_write(&self, path: &Path, content: &[u8]) -> io::Result<()> { debug!("Atomic Write {:?}", path); let full_path = self.resolve_path(path); - atomic_write(&full_path, content) + atomic_write(&full_path, content)?; + self.sync_directory() } fn acquire_lock(&self, lock: &Lock) -> Result {