backups: fix race condition in "tape" change event during backup

Ensure that outer tar/encryptor gets all the data *and EOF* before
signalling inner tar to continue. Previously it could happen that inner
tar begins to write next data chunk, while qvm-backup still holds
previous data chunk open.
This commit is contained in:
Marek Marczykowski-Górecki 2013-11-24 03:28:21 +01:00
parent 3d1b40f25c
commit 005db6a5ab

View File

@ -1173,6 +1173,8 @@ def backup_do_copy(base_backup_dir, files_to_backup, passphrase, progress_callba
hmac_file.flush()
hmac_file.close()
pipe.close()
# Send the HMAC to the backup target
to_send.put(os.path.relpath(chunkfile, backup_tmpdir)+".hmac")
@ -1185,7 +1187,6 @@ def backup_do_copy(base_backup_dir, files_to_backup, passphrase, progress_callba
else:
print "Finished tar sparse with error",tar_sparse.poll()
pipe.close()
to_send.put("FINISHED")
send_proc.join()