From: Tom Hughes Date: Thu, 28 Sep 2023 17:28:27 +0000 (+0100) Subject: Simplify fdirsync and avoid race closing the descriptor X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/2f19f1b5184c6ed91c67fe8152b20f00d9378b22 Simplify fdirsync and avoid race closing the descriptor --- 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