Browse Source

with-lock: close segment file before invoking subprocess

Thomas Waldmann 7 năm trước cách đây
mục cha
commit
b9dce0ebdc
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      src/borg/archiver.py

+ 3 - 0
src/borg/archiver.py

@@ -1467,6 +1467,9 @@ class Archiver:
         # the encryption key (and can operate just with encrypted data).
         data = repository.get(Manifest.MANIFEST_ID)
         repository.put(Manifest.MANIFEST_ID, data)
+        # usually, a 0 byte (open for writing) segment file would be visible in the filesystem here.
+        # we write and close this file, to rather have a valid segment file on disk, before invoking the subprocess.
+        repository.io.close_segment()
         try:
             # we exit with the return code we get from the subprocess
             return subprocess.call([args.command] + args.args)