The real deadlock on process network initialization was found: the volume downloader did not write asynchronously, which would result it waiting on writing to a process that would never be created.

This commit is contained in:
Carl Johnsen
2024-11-15 12:57:55 +01:00
parent 62e96935ad
commit effd50985f
3 changed files with 4 additions and 4 deletions
@@ -9,10 +9,10 @@ namespace Duplicati.Library.Main.Operation.Restore
// TODO Should maybe come from Options, or at least some global configuration file?
private static readonly int bufferSize = 128;
public static readonly ChannelMarkerWrapper<Database.LocalRestoreDatabase.IFileToRestore> filesToRestore = new(new ChannelNameAttribute("filesToRestore", bufferSize));
public static readonly ChannelMarkerWrapper<BlockRequest> downloadRequest = new(new ChannelNameAttribute("downloadRequest", bufferSize));
public static readonly ChannelMarkerWrapper<(BlockRequest, IDownloadWaitHandle)> downloadedVolume = new(new ChannelNameAttribute("downloadResponse", bufferSize));
public static readonly ChannelMarkerWrapper<Database.LocalRestoreDatabase.IFileToRestore> filesToRestore = new(new ChannelNameAttribute("filesToRestore", bufferSize));
public static readonly ChannelMarkerWrapper<(BlockRequest, byte[])> decompressedVolumes = new(new ChannelNameAttribute("decompressedVolumes", bufferSize));
public static readonly ChannelMarkerWrapper<(BlockRequest, TempFile)> decryptedVolume = new(new ChannelNameAttribute("decrytedVolume", bufferSize));
public static readonly ChannelMarkerWrapper<(BlockRequest, byte[])> decompressedVolumes = new(new ChannelNameAttribute("decompressedVolumes", bufferSize));
}
}
@@ -45,7 +45,7 @@ namespace Duplicati.Library.Main.Operation.Restore
}
}
self.Output.Write((block_request, f));
await self.Output.WriteAsync((block_request, f));
}
}
catch (RetiredException ex)
@@ -151,8 +151,8 @@ namespace Duplicati.Library.Main.Operation
var filelister = Restore.FileLister.Run(db, backend, filter, m_options, m_result);
var fileprocessors = Enumerable.Range(0, file_processors).Select(i => Restore.FileProcessor.Run(db, fileprocessor_requests[i], fileprocessor_responses[i], m_result)).ToArray();
var blockmanager = Restore.BlockManager.Run(fileprocessor_requests, fileprocessor_responses);
var volumedecrypters = Enumerable.Range(0, volume_decrypters).Select(i => Restore.VolumeDecrypter.Run()).ToArray();
var volumedownloaders = Enumerable.Range(0, volume_downloaders).Select(i => Restore.VolumeDownloader.Run(db, backend, m_options)).ToArray();
var volumedecrypters = Enumerable.Range(0, volume_decrypters).Select(i => Restore.VolumeDecrypter.Run()).ToArray();
var volumedecompressors = Enumerable.Range(0, volume_decompressors).Select(i => Restore.VolumeDecompressor.Run(m_options)).ToArray();
all =