Skip to content

fix(lock): reject zombie process owners - #3897

Open
august-agent wants to merge 1 commit into
kunchenguid:mainfrom
august-agent:fm/autoarm-liveness-split
Open

august-agent wants to merge 1 commit into
kunchenguid:mainfrom
august-agent:fm/autoarm-liveness-split

Conversation

@august-agent

Copy link
Copy Markdown

Summary

  • Treat zombie PIDs as dead when evaluating generic lock owners and session-lock harness owners.
  • Reclaim those stale owners so watcher and auto-arm recovery can proceed.
  • Preserve the existing stopped-owner retirement behavior and its SIGSTOP regression.

kill -0 succeeds for a zombie because the PID still exists, even though the process can no longer run or release its lock.
The existing liveness checks therefore preserve dead ownership indefinitely.
This change adds portable zombie-state checks using Linux-compatible /proc/<pid>/stat when available and ps otherwise, then applies them at the two existing owner-liveness boundaries.

This addresses #3620.
It is split out of #3617 at the maintainer's request so the liveness restoration can be reviewed on its own.

Tests

  • bin/fm-test-run.sh --jobs 1 tests/fm-watcher-lock.test.sh tests/fm-claude-stop-autoarm.test.sh - 2 suites passed.
  • The same command with only the two production-library edits removed - both new zombie-owner regressions failed, while they pass with this change.
  • The existing SIGSTOP regression passed and confirms that a stopped legacy owner is reclaimed after retirement is queued.
  • bin/fm-lint.sh - passed.

The complete bin/fm-test-run.sh --all walk is not green in this local environment because of aggregate-only failures already present on origin/main.
The potentially related fm-control-relaunch.test.sh assertion, relaunch did not reach trace delivery, passed in isolation but failed in two complete clean-origin/main runs with this commit absent (186 suites with 9 failures, then 186 suites with 10 failures).
That counterfactual rules out this patch as the cause; no open issue dedicated to that exact assertion was found.

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge, with the new zombie checks preserving live and stopped owners while reclaiming exited owners that cannot release their locks.

The changed liveness boundaries first retain the existing kill -0 check, then reject only process states explicitly reported as zombie through procfs or the portable ps fallback; the added tests cover both affected lock-recovery paths.

Reviews (1): Last reviewed commit: "fix(lock): reject zombie process owners" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant