Skip to content

MaxRestartAttempts upper bound of 100 is too restrictive for long-running system services #701

@Christophe-Rogiers

Description

@Christophe-Rogiers

Affected version: Servy 7.9.0 (PowerShell module Servy.psd1 ModuleVersion = '7.9.0', bundled servy-cli.exe dated 2026-04-16).

Previous behaviour: The prior CLI accepted values up to int.MaxValue (2,147,483,647). We installed services with Install-ServyService -MaxRestartAttempts 999999999 without error on earlier Servy releases.

In src/Servy.Core/Config/AppConfig.cs:

public const int MinMaxRestartAttempts = 1;
public const int MaxMaxRestartAttempts = 100;

100 restart attempts is too low for services designed to run indefinitely (monitoring, health, orchestration services on desktops/servers managed by configuration management). A service that restarts on transient failure can exhaust its budget within weeks, after which the service stops and silently stays dead.

Request: Either raise MaxMaxRestartAttempts to int.MaxValue (matching previous behaviour and the PowerShell module's [ValidateRange(1, 2147483647)]), introduce a sentinel value (0 or -1) meaning "unlimited", or make this configurable via appsettings.cli.json.

Impact: For a service expected to never stop, a hard cap of 100 restarts is effectively a guarantee that it will eventually stop.

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