diff --git a/Duplicati/Library/Main/Operation/Backup/DataBlockProcessor.cs b/Duplicati/Library/Main/Operation/Backup/DataBlockProcessor.cs index 672647177..a029bab95 100644 --- a/Duplicati/Library/Main/Operation/Backup/DataBlockProcessor.cs +++ b/Duplicati/Library/Main/Operation/Backup/DataBlockProcessor.cs @@ -106,7 +106,9 @@ namespace Duplicati.Library.Main.Operation.Backup { // If we have collected data, merge all pending volumes into a single volume if (blockvolume != null && blockvolume.SourceSize > 0) + { await self.SpillPickup.WriteAsync(new VolumeUploadRequest(blockvolume, true)); + } } throw; diff --git a/Duplicati/Library/Main/Volumes/VolumeWriterBase.cs b/Duplicati/Library/Main/Volumes/VolumeWriterBase.cs index d3b14404f..752563143 100644 --- a/Duplicati/Library/Main/Volumes/VolumeWriterBase.cs +++ b/Duplicati/Library/Main/Volumes/VolumeWriterBase.cs @@ -53,6 +53,9 @@ namespace Duplicati.Library.Main.Volumes else m_localfile = new Library.Utility.TempFile(); + // TODO(danstahr): This is a hack! Figure out why the file is being disposed of prematurely. + m_localfile.Protected = true; + ResetRemoteFilename(options, timestamp); m_compression = DynamicLoader.CompressionLoader.GetModule(options.CompressionModule, m_localfile, options.RawOptions); @@ -77,6 +80,8 @@ namespace Duplicati.Library.Main.Volumes try { m_compression.Dispose(); } finally { m_compression = null; } + m_localfile.Protected = false; + if (m_localfile != null) try { m_localfile.Dispose(); } finally { m_localfile = null; } diff --git a/Duplicati/Library/Utility/TempFile.cs b/Duplicati/Library/Utility/TempFile.cs index 21e645ca2..92e114b09 100644 --- a/Duplicati/Library/Utility/TempFile.cs +++ b/Duplicati/Library/Utility/TempFile.cs @@ -34,10 +34,10 @@ namespace Duplicati.Library.Utility public static string APPLICATION_PREFIX = Utility.getEntryAssembly().FullName.Substring(0, 3).ToLower() + "-"; private string m_path; - private bool m_protect; - + private bool m_protect; + #if DEBUG - //In debug mode, we track the creation of temporary files, and encode the generating method into the name + //In debug mode, we track the creation of temporary files, and encode the generating method into the name private static object m_lock = new object(); private static Dictionary m_fileTrace = new Dictionary(); @@ -72,7 +72,6 @@ namespace Duplicati.Library.Utility m_fileTrace.Add(s, st); return s; } - #else private static string GenerateUniqueName() { @@ -84,7 +83,7 @@ namespace Duplicati.Library.Utility /// Gets all temporary files found in the current tempdir, that matches the application prefix /// /// The application temp files. - public static IEnumerable GetApplicationTempFiles() + private static IEnumerable GetApplicationTempFiles() { return System.IO.Directory.GetFiles(TempFolder.SystemTempPath, APPLICATION_PREFIX + "*"); }