Repository navigation
Read a legacy daemon that exited unreaped as gone in explicit controls - #210
Merged
Merged
Conversation
check_daemon_identity has read a zombie as Gone since #207, but the pre-boot-ID branch of check_control_identity still looked only at the thread group and the start token, and a zombie keeps both. A legacy record over a killed, unreaped daemon was LegacyVerified there, and that is the verifier attach also uses since #209. Nothing acted on it wrongly. Attach, kill and rm read the inventory identity first, which is Gone, and rm's exit wait counts a zombie as exited. But the target resolution that attach and child signals share returned the zombie's PID, so a signal went on to ask a dead daemon for STATUS instead of reporting the session not running. Read the zombie state in the same /proc/<pid>/status read on Linux, and from the process table row on macOS, as check_daemon_identity does.
Contributor
Author
|
Independent read GO at exact head Read:
Risks (low):
|
This was referenced Nov 4, 2026
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.
A follow-up to #207 and #209, found in a post-merge read of #209.
Cause. #207 made
check_daemon_identityread a zombie asGone.check_control_identitysends modern records through that function, but its pre-boot-ID branch (nodaemonBootId) checked only the thread group and the start token, and a zombie keeps both. So a legacy record over a killed, unreaped daemon read asLegacyVerified. Since #209, attach is one of that verifier's callers, throughread_control_signal_target_with.What it affected. Nothing I found acted on it wrongly:
Gone, so they never reach the legacy branch. Measured with the CLI (below).has_process_exited_for_reap.pty_client::signal, library only) resolve their target with the same function and have no inventory check. A legacy zombie therefore came back as the target. The next step asks a dead daemon for STATUS, which can only fail, so the caller got that error instead ofNotRunning. This is from reading the code; I didn't run it.Fix. The legacy branch now reads the zombie state the way
check_daemon_identitydoes:State:from the same/proc/<pid>/statusread that givesTgid:(linux_leader_status).SZOMBrow from the process table.Tests.
registry::list::control_identity_tests::a_legacy_daemon_that_exited_unreaped_is_gone_not_verified.LegacyVerified, and it's the attach and signal target.Gone, with no target.Gone.left: LegacyVerified, right: Gone, on Linux and on macOS./bin/psexists, so they ran and did not skip. The release build's macOS check phase has nops, so there the test skips.cargo test -p pty-core -p pty-client: 658 passed.-p ptywithcli_attach_guard,client_library,cli_rm,cli_e2e,cli_binary_upgrade,cli_up_downanddaemon_lifecycle: 71 passed, 1 ignored.daemonPid,daemonStartToken, a PID sidecar, nodaemonBootId), over asleepthat is killed and never waited for. Output is the same on d618d49 (before fix: attach to token-verified legacy daemons #209), 74e4dbb (fix: attach to token-verified legacy daemons #209 merged) and this branch:pty list --jsonpty attach --no-restart zpty kill zstatus=vanished identity=goneSession "z" is not running (status: vanished).Session "z" is not running. Use "pty rm z" to remove it.Not changed. No tier-1 files, no JSON shape, no status values. Modern records with boot evidence take the same path as before.