Summary
If apfel crashes exactly at quit time, the sequence handleCrash (1s sleep) + start (500ms sleep + health) + killProcessOnPort (up to 3s) can total ~4.7s, marginally exceeding the 4s termination semaphore.
Decision
This is accepted as residual risk — probability is very low, and if it fires the apfel process is eventually reclaimed by the OS with no data loss.
Action
Add a comment near the semaphore in ApfelServerManager (or AppDelegate) explaining the known race and why it is tolerated. No code change needed.
Summary
If apfel crashes exactly at quit time, the sequence
handleCrash(1s sleep) +start(500ms sleep + health) +killProcessOnPort(up to 3s) can total ~4.7s, marginally exceeding the 4s termination semaphore.Decision
This is accepted as residual risk — probability is very low, and if it fires the apfel process is eventually reclaimed by the OS with no data loss.
Action
Add a comment near the semaphore in
ApfelServerManager(orAppDelegate) explaining the known race and why it is tolerated. No code change needed.