diff --git a/vcsserver/lib/rc_cache/archive_cache/fanout_cache.py b/vcsserver/lib/rc_cache/archive_cache/fanout_cache.py --- a/vcsserver/lib/rc_cache/archive_cache/fanout_cache.py +++ b/vcsserver/lib/rc_cache/archive_cache/fanout_cache.py @@ -138,6 +138,13 @@ class FileSystemCache: for chunk in iterator: size += len(chunk) writer.write(chunk) + writer.flush() + # Get the file descriptor + fd = writer.fileno() + + # Sync the file descriptor to disk, helps with NFS cases... + os.fsync(fd) + log.debug('written new archive cache under %s', full_path) return size def _get_keyfile(self, key):