Repository navigation
fix(status): bound systemd service probes so status cannot hang on a wedged systemctl (#84698) - #94149
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 9:50 AM ET / 13:50 UTC. Summary PR surface: Source +41, Tests +27. Total +68 across 10 files. Reproducibility: yes. for the component path: current main reaches unbounded systemctl calls from status service summaries, and the PR body provides before/after live output against a wedged systemctl double. I did not run a full CLI reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this focused Linux systemd timeout fix after maintainers accept or tune the 5s default-bound tradeoff, while keeping macOS and Windows service-manager timeout work separate. Do we have a high-confidence way to reproduce the issue? Yes for the component path: current main reaches unbounded systemctl calls from status service summaries, and the PR body provides before/after live output against a wedged systemctl double. I did not run a full CLI reproduction in this read-only review. Is this the best way to solve the issue? Yes for the linked Linux regression: forwarding the existing status deadline into read-only systemd probes is the narrow maintainable fix. The default 5s fallback is the remaining maintainer tradeoff, not a code-path defect. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f936c6b49504. Label changesLabel justifications:
Evidence reviewedPR surface: Source +41, Tests +27. Total +68 across 10 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
4cdab80 to
4f30544
Compare
4f30544 to
e0f4df9
Compare
) Keep both the openclaw#84698 timeout regression tests and the crash-loop supervision counter test added on main. Co-authored-by: Cursor <[email protected]>
vincentkoc
left a comment
There was a problem hiding this comment.
Reviewed the status/systemd timeout path and the tradeoff. Bounded degraded status output is the right behavior for a diagnostic command; control/install paths remain unbounded.
…wedged systemctl (openclaw#84698) (openclaw#94149) * fix(status): bound systemd service probes so status cannot hang on a wedged systemctl (openclaw#84698) * test(daemon): assert readRuntime receives the threaded status timeout opts (openclaw#84698) --------- Co-authored-by: Cursor <[email protected]>
…wedged systemctl (openclaw#84698) (openclaw#94149) * fix(status): bound systemd service probes so status cannot hang on a wedged systemctl (openclaw#84698) * test(daemon): assert readRuntime receives the threaded status timeout opts (openclaw#84698) --------- Co-authored-by: Cursor <[email protected]> (cherry picked from commit b6ad306)
Summary
openclaw statushanging until an external timeout (exit 124) when the systemd user/system manager is wedged: the service-summary probe spawnedsystemctlwith no deadline, so--timeoutwas advertised but never applied to it.resolveStatusServiceSummaries→readGatewayServiceState→ the systemd read helpers →execSystemctl/execSystemctlUser, and passes it toexecFileastimeout+killSignal: SIGKILLso a stucksystemctlchild is killed and the command fails soft to a degraded ("unknown") service row instead of hanging. A default 5s bound applies whenstatusruns without--timeout.systemctl start/stop/enable/...) unchanged — they pass no timeout, so their behavior is identical to today.Linked context
Closes #84698
Real behavior proof
openclaw status(andstatus --all) hangs indefinitely / exits 124 whensystemctldoes not return, ignoring--timeout.systemctlreplaced onPATHby a wedged double (#!/usr/bin/env bash…sleep 120) that simulates a stuck systemd socket. Production code path exercised:resolveStatusServiceSummaries→readGatewayServiceState→readSystemdServiceRuntime/isSystemdServiceEnabled→execSystemctl. This spawns a real child process (not a mock).main,resolveStatusRuntimeDetailsawaitsresolveStatusServiceSummaries()with no timeout argument, andexecSystemctlcallsexecFileUtf8("systemctl", …)with notimeout, so a non-returningsystemctlblocks the event loop forever.node:child_processexecFile'stimeoutoption kills the child on expiry (verified directly: callback fired at 1506ms withkilled=true signal=SIGKILL), which lets the command settle.resolveStatusServiceSummaries(2000)against the wedgedsystemctldouble on pristineupstream/main, with an 8s watchdog:resolveStatusServiceSummaries(2000)on this branch against the same wedgedsystemctldouble onPATH, capturing the returned rows and the double's invocation log.statuscalls are killed at the 2s deadline before theshowcalls run:openclaw statusno longer hangs on a wedgedsystemctl; it returns a degraded service row and respects the configured deadline (worst case ≈ 2× the deadline per service for the sequentialstatus+showprobes, parallelized across gateway/node).openclaw statusCLI end-to-end on this machine — on my checkout the command stalls earlier, before the service-summary stage (no gateway running), on cleanmaintoo, so the box cannot exercise the full CLI hang. The defect and fix were therefore proven at the owning component with a real wedgedsystemctlsubprocess. launchd (macOS) and Windows scheduled-task probes are left unchanged here; the newtimeoutMs/GatewayServiceReadOptionsplumbing makes wiring them later trivial, and those are tracked by separate open reports.systemctlis a deliberately hanging real binary onPATH, not the production systemd daemon; this matches the reported failure mode (systemd socket wedged before reply).Tests and validation
git diff --checknode scripts/run-vitest.mjs src/daemon/systemd.test.ts(92 passed, incl. 2 new regressions)node scripts/run-vitest.mjs src/commands/status-runtime-shared.test.ts src/commands/status.daemon.test.tspnpm tsgo:coreandpnpm tsgo:core:test(clean);oxfmt --checkand oxlint clean on the changed files.Risk checklist
Did user-visible behavior change?
Yes—openclaw statusnow returns a degraded service row under a wedged service manager instead of hanging; happy-path output is unchanged.Did config, environment, or migration behavior change?
NoDid security, auth, secrets, network, or tool execution behavior change?
NoHighest-risk area: the shared
readGatewayServiceState/GatewayService.readRuntimesignature, used by gateway and node services.How is that risk mitigated? The new
timeoutMs/optsare optional; only status read paths pass them, so control/install flows and other callers keep their current (unbounded) behavior, and typecheck confirms all call sites.Current review state: maintainer review and CI.
AI-assisted (Claude). Proof above was run manually.