You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(sandbox): an exec that exits during its 2 s output drain can still be reported as stalled #4722
When an exec's command exits, runnerd waits up to EXIT_DRAIN_GRACE_MS (2 s) for its stdio to close before it emits the terminal event (services/sandbox-runtime/daemon/src/exec-manager.ts:1010-1017). record.finishing is only set once finish() runs (exec-manager.ts:876-879), and the stall watch only lets go of the exec later still (exec-manager.ts:1376). Verified on main at 73d03a9.
If a stall-watch round lands inside that grace for an exec that had been quiet for the window, endStalled sees finishing === false (exec-manager.ts:1174-1183), marks it stalled, signals the group, and the terminal event carries failure: 'EXEC_STALLED' (exec-manager.ts:910) — although the command ended by itself with its own exit code. A backgrounded grandchild that holds the pipe makes the full 2 s likely. The platform then records turn_stalled, with no retry, for a turn that finished.
Suggested fix
In endStalled, also stand down once rec.processState.leaderExited is set (or unwatch the exec in commandExit). Test: a command exits while a backgrounded child holds stdout open, a stall round is forced inside the grace, and the exec reports its own exit code without EXEC_STALLED.
Activity
fix(sandbox): never end an exec as stalled once its command exited
fix(sandbox): never end an exec as stalled once its command exited