Repository navigation
v0.11.2
Emergency stability follow-up to 0.11.1. Fixes the documented "daemon
event loop freezes after 10-15 min productive window" pattern that has
been the #1 reliability issue for weeks of live-agent monitoring.
Fixes
- Daemon event loop freeze after 10-15 min productive window —
The parent-sideChannelto each shim subprocess had a read timeout
(25ms) but no write timeout.Channel::sendcalled
stream.write_all(), which on Unix stream sockets blocks
indefinitely when the peer stops draining its receive buffer. Under
normal operation shims read commands as fast as they arrive, so the
block never materialises — but when a shim wedges (slow codex tool
call, hung SDK stream, blocked subprocess), its receive buffer fills
up and the daemon's nextsend_ping/send_kill/Resize/
message delivery blocks insidewrite_allwaiting for bytes that
never drain. Theping_ponghealth subsystem runs inside the main
poll loop, so one wedged shim freezes the entire event loop: no
more merges, no more dispatch, no more logging. Restart buys another
10-15 min productive window before the cycle repeats. New
Channel::set_write_timeouthelper mirrorsset_read_timeout;
shim_spawn::spawn_shimapplies a 2-second ceiling so a wedged
shim surfaces as a send error within one or two ping_pong cycles
and flows through the usual stale-handle / respawn path instead of
hanging forever. Regression test
shim::protocol::tests::send_times_out_when_peer_stops_reading
opens a socketpair, sets a 50ms write timeout, and blasts large
payloads without ever draining the peer — assertssend()returns
a WouldBlock/TimedOut error within 5s instead of hanging.
(src/shim/protocol.rs,src/team/daemon/shim_spawn.rs)