mirror of https://github.com/borgbackup/borg.git
with-lock: close segment file before invoking subprocess
(cherry picked from commit b9dce0ebdc
)
This commit is contained in:
parent
ff9c511be3
commit
eeaa43b668
|
@ -1664,6 +1664,11 @@ class Archiver:
|
||||||
# the encryption key (and can operate just with encrypted data).
|
# the encryption key (and can operate just with encrypted data).
|
||||||
data = repository.get(Manifest.MANIFEST_ID)
|
data = repository.get(Manifest.MANIFEST_ID)
|
||||||
repository.put(Manifest.MANIFEST_ID, data)
|
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.
|
||||||
|
# we can only do this for local repositories (with .io), though:
|
||||||
|
if hasattr(repository, 'io'):
|
||||||
|
repository.io.close_segment()
|
||||||
try:
|
try:
|
||||||
# we exit with the return code we get from the subprocess
|
# we exit with the return code we get from the subprocess
|
||||||
return subprocess.call([args.command] + args.args)
|
return subprocess.call([args.command] + args.args)
|
||||||
|
|
Loading…
Reference in New Issue