aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-11-12 18:59:48 -0600
committerJP Dillingham <jp@dillingham.me>2026-11-12 18:59:48 -0600
commit52a411477d89aa8bc128383725b9846d8fb6d791 (patch)
tree1ff16f09bed3ea6c63777fe0bdc19f54316f6327
parent08c378db4f81f0d4147c35be172617393b9d005b (diff)
downloadslskd-52a411477d89aa8bc128383725b9846d8fb6d791.tar.gz
document cts registration behavior
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs5
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);
});