Repository navigation
fix(infra): gateway pid probe no longer hangs when ps sampling stalls - #109731
Conversation
readGatewayProcessArgsSync probes ps to verify gateway argv before signaling or reporting listener PIDs. The darwin branch already passed timeout: 1000, but spawnSync defaults killSignal to SIGTERM, which an unresponsive or hung ps child can ignore and keep the gateway process blocked past the timeout. Force killSignal: SIGKILL (matching the doctor probe fix in openclaw#109243) so a stalled ps probe is reaped at the deadline instead of hanging gateway signal verification and listener PID discovery. Extract GATEWAY_PS_PROBE_TIMEOUT_MS for the named timeout and assert the full spawnSync options (encoding / killSignal / timeout) in the darwin test.
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 5:08 AM ET / 09:08 UTC. Summary PR surface: Source +5, Tests +14. Total +19 across 7 files. Reproducibility: no. high-confidence live current-main reproduction is included. The source path makes the stall reproducible by contract, but the submitted evidence is limited to mocked unit assertions. Review metrics: 1 noteworthy metric.
Stored data model 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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch, retain one shared bounded Do we have a high-confidence way to reproduce the issue? No high-confidence live current-main reproduction is included. The source path makes the stall reproducible by contract, but the submitted evidence is limited to mocked unit assertions. Is this the best way to solve the issue? Yes, the shared helper is the narrowest maintainable fix because it centralizes the timeout-kill invariant instead of leaving one-off options at each AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ff4f0161fca. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5, Tests +14. Total +19 across 7 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
|
Co-authored-by: 琚耀辉0668001366 <[email protected]>
|
Merged via squash.
|
…openclaw#109731) * fix(infra): gateway pid probe no longer hangs when ps sampling stalls readGatewayProcessArgsSync probes ps to verify gateway argv before signaling or reporting listener PIDs. The darwin branch already passed timeout: 1000, but spawnSync defaults killSignal to SIGTERM, which an unresponsive or hung ps child can ignore and keep the gateway process blocked past the timeout. Force killSignal: SIGKILL (matching the doctor probe fix in openclaw#109243) so a stalled ps probe is reaped at the deadline instead of hanging gateway signal verification and listener PID discovery. Extract GATEWAY_PS_PROBE_TIMEOUT_MS for the named timeout and assert the full spawnSync options (encoding / killSignal / timeout) in the darwin test. * refactor: centralize bounded ps probes Co-authored-by: 琚耀辉0668001366 <[email protected]> * refactor: leave doctor ps hardening to main --------- Co-authored-by: Peter Steinberger <[email protected]>
…openclaw#109731) * fix(infra): gateway pid probe no longer hangs when ps sampling stalls readGatewayProcessArgsSync probes ps to verify gateway argv before signaling or reporting listener PIDs. The darwin branch already passed timeout: 1000, but spawnSync defaults killSignal to SIGTERM, which an unresponsive or hung ps child can ignore and keep the gateway process blocked past the timeout. Force killSignal: SIGKILL (matching the doctor probe fix in openclaw#109243) so a stalled ps probe is reaped at the deadline instead of hanging gateway signal verification and listener PID discovery. Extract GATEWAY_PS_PROBE_TIMEOUT_MS for the named timeout and assert the full spawnSync options (encoding / killSignal / timeout) in the darwin test. * refactor: centralize bounded ps probes Co-authored-by: 琚耀辉0668001366 <[email protected]> * refactor: leave doctor ps hardening to main --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
readGatewayProcessArgsSync(insrc/infra/gateway-processes.ts) probespson darwin to read a gateway process's argv before signaling it or reporting it as a verified listener PID. The darwin branch already passed a 1000ms timeout, but {BT}spawnSync{BT} defaultskillSignalto SIGTERM, which an unresponsive or hungpschild can ignore. As a result a stalledpsprobe can keep the gateway process blocked past the configured timeout, hanging gateway signal verification and listener PID discovery.This is the same class of stall already fixed for the doctor TUI process probe in #109243, applied to the gateway's own pid-verification path.
Evidence
killSignal: "SIGKILL"to thespawnSync("ps", ...)call so a stalled probe is reaped at the deadline instead of hanging, and extracts the timeout into a namedGATEWAY_PS_PROBE_TIMEOUT_MSconstant.src/infra/gateway-processes.test.tsis green: 8 passed (8), including the darwin path.spawnSyncoptions shape - encoding, killSignal, timeout - locking in the behavior (mirrors the assertion added in fix(doctor): doctor no longer hangs when TUI process sampling stalls #109243).Siblings of the same series (already merged, same spawnSync + killSignal: SIGKILL shape): #109243 (doctor WhatsApp responsiveness / TUI process sampling), #109458 (footer git probe).