diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-11-12 18:59:48 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-11-12 18:59:48 -0600 |
| commit | 52a411477d89aa8bc128383725b9846d8fb6d791 (patch) | |
| tree | 1ff16f09bed3ea6c63777fe0bdc19f54316f6327 /src | |
| parent | 08c378db4f81f0d4147c35be172617393b9d005b (diff) | |
| download | slskd-52a411477d89aa8bc128383725b9846d8fb6d791.tar.gz | |
document cts registration behavior
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 2b8bbf8d..d4b07878 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -549,13 +549,12 @@ namespace slskd.Transfers.Downloads using var timeoutCts = new CancellationTokenSource(maxTimeToWaitForEnqueueRequestAck); timeoutCts.Token.Register(() => { + // note: disposed once we leave the try block, so registration doesn't fire unless it actually times out 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 + // cancel the download attempt so that it doesn't keep running (within Soulseek.NET) 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(swallowObjectDisposedException: true); }); |
