Repository navigation
fix: pidfile any-alive contract — closes status/send disagreement - #316
Merged
Merged
Conversation
…sm bug)
vhsm-d1f4 + authenticator-448f independently reproduced 2026-04-29:
.airc/airc.pid had 3 PIDs, 1 dead. cmd_status used any-alive logic
('running PID X'); cmd_send used all-alive logic ('Send NOT delivered
— pidfile stale'). Two liveness checks in the same binary disagreed
silently for ~10 minutes per repro.
Extract prune_pidfile_and_count to airc top-level. Both call sites
use it. Single contract: 'alive' means at least one PID in the
pidfile is alive. Auto-prunes dead orphans in-place so the file
converges on truth (no manual intervention to fix a poisoned
pidfile).
Live-tested: pidfile with 1 alive + 1 dead returns count=1, file
post-prune contains only the alive pid.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vhsm + authenticator both repro'd: pidfile with 1 stale orphan + N live processes → status says 'running', msg says 'pidfile stale'. Extracted shared helper, both sites use it, dead orphans auto-pruned.