Bug
UninstallServiceAsync uses Thread.Sleep(500) in a polling loop while waiting for a service to stop:
while (sc.Status != ServiceControllerStatus.Stopped && DateTime.Now < waitUntil)
{
Thread.Sleep(500); // Blocks thread pool thread
sc.Refresh();
}
Since this is an async method, Thread.Sleep blocks the thread pool thread instead of yielding it.
Impact
Under load (e.g. bulk uninstall operations), this can exhaust thread pool threads and degrade application responsiveness.
Suggested fix
Replace with await Task.Delay(500).
File
src/Servy.Core/Services/ServiceManager.cs — line 570
Bug
UninstallServiceAsyncusesThread.Sleep(500)in a polling loop while waiting for a service to stop:Since this is an
asyncmethod,Thread.Sleepblocks the thread pool thread instead of yielding it.Impact
Under load (e.g. bulk uninstall operations), this can exhaust thread pool threads and degrade application responsiveness.
Suggested fix
Replace with
await Task.Delay(500).File
src/Servy.Core/Services/ServiceManager.cs— line 570