Severity: Warning
File: src/Servy.Service/Service.cs, line 1946
Description:
In the healthy-process path of CheckHealth, ConditionalResetRestartAttemptsAsync is called at line 1946 while _healthCheckSemaphore is still held. This method performs File.ReadAllTextAsync and potentially File.WriteAllTextAsync (disk I/O).
Every heartbeat tick where the process is healthy and the restart counter is non-zero blocks the semaphore for the duration of a disk read/write. Any concurrent OnProcessExited call stalls on _healthCheckSemaphore.Wait() at line 1618, delaying exit-event processing.
Design decision needed:
The restart counter file access does not modify shared in-memory state, so it could be moved outside the semaphore. However, this changes the ordering guarantees between health checks and exit events. What level of consistency is needed between _failedChecks and the restart counter file?
Severity: Warning
File:
src/Servy.Service/Service.cs, line 1946Description:
In the healthy-process path of
CheckHealth,ConditionalResetRestartAttemptsAsyncis called at line 1946 while_healthCheckSemaphoreis still held. This method performsFile.ReadAllTextAsyncand potentiallyFile.WriteAllTextAsync(disk I/O).Every heartbeat tick where the process is healthy and the restart counter is non-zero blocks the semaphore for the duration of a disk read/write. Any concurrent
OnProcessExitedcall stalls on_healthCheckSemaphore.Wait()at line 1618, delaying exit-event processing.Design decision needed:
The restart counter file access does not modify shared in-memory state, so it could be moved outside the semaphore. However, this changes the ordering guarantees between health checks and exit events. What level of consistency is needed between
_failedChecksand the restart counter file?