Repository navigation
feat(daemon): let supervisors check monitor runtimes without a request - #413
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Review covered all four changed files and traced record publication, process identity inspection, exit handling, recovery, and test lifeline inheritance.
- Synchronous runtime inspection:
live_runtimereturns the recorded instance and runtime PID only when the boot session and both process start identities match, without querying the monitor. - Recorded subject enumeration:
recorded_monitor_subjectslists published records in sorted order while ignoring reservation files and unpublished directories, preserving errors for invalid records. - Test lifeline fallback and coverage: Hooks supply a lifeline when the start request provides none, and the integration tests cover live/post-stop inspection, enumeration, and hook-driven cleanup.
cargo fmt --all --check passed. The changed process tests are macOS-only and could not run on this Linux runner; macOS CI was still pending when inspected.
gpt-6.1-sol | 𝕏
5 tasks done
clvsh
added this pull request to stack #415
October 10, 2026 06:11
live_runtime reports a monitor's runtime from its record alone: the monitor and runtime must both still run as recorded, from this boot. An identity lookup never finds a process that has exited, and a monitor reaps its runtime only after recording the exit, so no socket request is needed. That keeps the check synchronous, as the supervisor's ownership checks, the Caddy admin verifier and the health scan are. recorded_monitor_subjects lists the monitors that have published a record, for disable and uninstall. Test hooks can now supply the test process's lifeline for monitors whose controller passes none, as a daemon running inside a test does.
clvsh
force-pushed
the
feat/service-monitor-prep
branch
from
October 10, 2026 17:37
e8299ad to
f5ccf6f
Compare
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.

PR 4a of the monitor stack, on top of #412. It adds what the cutover PR (4b) needs from the monitor engine. Production behavior doesn't change; nothing calls these yet.
What's added
live_runtime(paths, subject)reports a monitor's runtime (its instance and pid) without sending the monitor a request. It reads the monitor's record and checks that the boot session, the monitor's start identity and the runtime's start identity all still match.Somemeans the monitor is alive and its runtime has not exited.recorded_monitor_subjects(paths)lists the monitors that have published a record. Disable and uninstall will use it in 4b.MonitorHooks.lifeline_fd: test hooks can supply the test process's lifeline for monitors whose controller passes none. A daemon running inside a test starts runtimes without a lifeline, so this is how 4b's daemon tests will still clean up when a test dies. Productionpvalways uses the default hooks.Why this PR is small
The plan had 4a also rewrite the runtime test fixtures so they would work both before and after the cutover. That would have been throwaway work. Once runtimes run under monitors, the test lifeline cleans up every runtime when a test process exits. Most of the pid-file fixture guards (about 430 lines in
gateway_reconciliation.rsalone) then get deleted in 4b rather than rewritten.MonitorStatedoesn't gain aninstancefield either. The state reply's envelope already carriesinstance, and the flattened state would emit it twice. 4b reads the instance throughlive_runtimeinstead.Test plan
live_runtimematches the record while the runtime runs and returnsNoneonce the monitor only holds the exit.recorded_monitor_subjectslists the subject before release and nothing after it.--stress-count 5, all passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings,cargo fmt --all --checkandcargo shearare clean.Summary by CodeRabbit