From f8470630be0f3fa7b8052ebd822f23531d30da2f Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Sat, 5 Sep 2026 09:58:04 +0200 Subject: Retire runners that are cancelled before they start --- .../LibraryTaskScheduler/LimitedConcurrencyLibraryScheduler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Controller/LibraryTaskScheduler') diff --git a/MediaBrowser.Controller/LibraryTaskScheduler/LimitedConcurrencyLibraryScheduler.cs b/MediaBrowser.Controller/LibraryTaskScheduler/LimitedConcurrencyLibraryScheduler.cs index 3c6ffe3cbd..be75117b6f 100644 --- a/MediaBrowser.Controller/LibraryTaskScheduler/LimitedConcurrencyLibraryScheduler.cs +++ b/MediaBrowser.Controller/LibraryTaskScheduler/LimitedConcurrencyLibraryScheduler.cs @@ -191,12 +191,14 @@ public sealed class LimitedConcurrencyLibraryScheduler : ILimitedConcurrencyLibr // Keyed on its own stop source, because cancelling that is what reaches the linked // source the runner waits on. Cancellation does not travel the other way. + // Started without the runner's own token: a task cancelled before it is scheduled + // never runs its body, so it would never take itself out of _taskRunners again. _taskRunners.Add( stopToken, Task.Factory.StartNew( ItemWorker, (stopToken, combinedSource), - combinedSource.Token, + CancellationToken.None, TaskCreationOptions.PreferFairness, TaskScheduler.Default)); } -- cgit v1.2.3