Skip to content

[Robustness] ServiceManager.StartServiceAsync — No differentiation between TimeoutException and other failures #514

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Warning

File: src/Servy.Core/Services/ServiceManager.cs, lines 638–675

Description:
sc.WaitForStatus(...) throws System.ServiceProcess.TimeoutException when a service is slow to start (normal for slow-starting services). This is caught by a generic catch (Exception ex), logged as Logger.Error(...), and returned as OperationResult.Failure.

For services with legitimately long start times, this fills the event log with false-positive errors on every restart.

Suggested fix:
Catch TimeoutException specifically and log as a warning with the service name and configured timeout value. Only log Error for unexpected exceptions.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions