From 2f19f1b5184c6ed91c67fe8152b20f00d9378b22 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 28 Sep 2023 18:28:27 +0100 Subject: [PATCH] Simplify fdirsync and avoid race closing the descriptor --- .../files/default/replication-bin/replicate-changesets | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index 5d47266e6..92b5408d7 100755 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -128,10 +128,7 @@ end # to guarantee sync for newly created directories. def fdirsync(d) while d != "/" - Dir.open(d) do |dh| - io = IO.for_fd(dh.fileno) - io.fsync - end + fsync(d) d = File.dirname(d) end end -- 2.39.5