Merge "ChunkedBackupDriver: Freeing memory on restore" into stable/rocky

This commit is contained in:
Zuul 2020-03-23 11:25:13 +00:00 committed by Gerrit Code Review
commit fda8a8f86d
1 changed files with 3 additions and 0 deletions

View File

@ -711,9 +711,12 @@ class ChunkedBackupDriver(driver.BackupDriver):
LOG.debug('decompressing data using %s algorithm',
compression_algorithm)
decompressed = decompressor.decompress(body)
body = None # Allow Python to free it
volume_file.write(decompressed)
decompressed = None # Allow Python to free it
else:
volume_file.write(body)
body = None # Allow Python to free it
# force flush every write to avoid long blocking write on close
volume_file.flush()