Severity: Warning
File: src/Servy.Manager/Services/ServiceCommands.cs
Lines: 710–714
Description:
_serviceLocks is a ConcurrentDictionary<string, SemaphoreSlim> that grows by one SemaphoreSlim per unique service name via GetOrAdd. Entries are never evicted after a service is removed — only at Dispose(). If services are repeatedly added and removed (e.g., automated deployments), the dictionary accumulates stale SemaphoreSlim objects indefinitely.
Suggested fix:
Remove entries from _serviceLocks after the last operation completes (e.g., TryRemove after Release if the semaphore count returns to 1), or prune periodically.
Severity: Warning
File:
src/Servy.Manager/Services/ServiceCommands.csLines: 710–714
Description:
_serviceLocksis aConcurrentDictionary<string, SemaphoreSlim>that grows by oneSemaphoreSlimper unique service name viaGetOrAdd. Entries are never evicted after a service is removed — only atDispose(). If services are repeatedly added and removed (e.g., automated deployments), the dictionary accumulates staleSemaphoreSlimobjects indefinitely.Suggested fix:
Remove entries from
_serviceLocksafter the last operation completes (e.g.,TryRemoveafterReleaseif the semaphore count returns to 1), or prune periodically.