Severity: Warning
File: src/Servy.Manager/Services/ServiceCommands.cs, lines 30, 666
Description:
_serviceLocks is a ConcurrentDictionary<string, SemaphoreSlim>. Each SemaphoreSlim is IDisposable. Semaphores are added via GetOrAdd but never removed — not when a service is removed, not on shutdown.
In long-running sessions with frequent service adds/removes, this is a slow accumulation of undisposed kernel objects.
Design decision needed:
Should semaphores be removed when a service is uninstalled/removed? Should ServiceCommands implement IDisposable to dispose all semaphores on shutdown? The choice depends on whether semaphore re-creation has measurable cost vs. the leak risk.
Severity: Warning
File:
src/Servy.Manager/Services/ServiceCommands.cs, lines 30, 666Description:
_serviceLocksis aConcurrentDictionary<string, SemaphoreSlim>. EachSemaphoreSlimisIDisposable. Semaphores are added viaGetOrAddbut never removed — not when a service is removed, not on shutdown.In long-running sessions with frequent service adds/removes, this is a slow accumulation of undisposed kernel objects.
Design decision needed:
Should semaphores be removed when a service is uninstalled/removed? Should
ServiceCommandsimplementIDisposableto dispose all semaphores on shutdown? The choice depends on whether semaphore re-creation has measurable cost vs. the leak risk.