diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-08-22 13:10:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-22 13:10:46 -0500 |
| commit | 5770c7e4d489ac9580a1ea268ce8952b6436b72d (patch) | |
| tree | c05e505b116a89a4a3cfeecf5a9ca662e58f155b /src | |
| parent | c80e3f45201d8095f8952786ee69009d2793d91f (diff) | |
| parent | 858a458125dd2bb1cbb412192fd3399d2a2315c7 (diff) | |
| download | slskd-5770c7e4d489ac9580a1ea268ce8952b6436b72d.tar.gz | |
Merge pull request #1827 from slskd/abandon-cancel
Cancel downloads when their enqueue attempt times out
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index a4d48279..30f3c9b1 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -550,6 +550,12 @@ namespace slskd.Transfers.Downloads { Log.Warning("Download of {Filename} from {Username} failed to enqueue remotely after hard time limit of {Duration} seconds. State transition history: {History}", transfer.Filename, username, maxTimeToWaitForEnqueueRequestAck.TotalSeconds, string.Join(", ", transitions)); enqueuedTcs.TrySetException(new TimeoutException($"Download failed to enqueue remotely after hard time limit of {maxTimeToWaitForEnqueueRequestAck.TotalSeconds} secs")); + + // cancel the download attempt so that it doesn't keep running and cause the internal + // state of slskd to diverge from the internal state of Soulseek.NET. + // the transfer record is recorded as being cancelled when this happens and there's not + // an easy/good way to stop it. + cts.Cancel(); }); // satisfies conditions #1 and #2 |
