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
Socket drain after a kill never ends while a child process keeps writing #76867
cleanup_sockets_after_kill() in the task SDK supervisor reads each log socket until it closes. If the killed process started a child that inherited its stdout and keeps writing, the socket never closes and the drain never ends. On main this hits the Dag processor: when a Dag file's parse starts such a child and the parse times out, the processor stops parsing for good, with a stale heartbeat and 100% CPU.
Shutting down the read side of the sockets before draining fixes it, so the drain reads only what is already queued.
This also blocks a change to the triggerer from #76527: on stop, drain the trigger runner's sockets before uploading the watcher log files. Without that drain the runner's last lines are lost, because they are still in the socket when the files are uploaded (as on main). That change was taken out of #76527 because it hangs on this bug.
Shut down the read side before cleanup_sockets_after_kill() drains, with a test for a child that keeps writing
Hi, I'd like to work on this. I'd shut down the read side of the log sockets in cleanup_sockets_after_kill() before the drain loop, so it only reads what's already queued, and add a supervisor test with a socketpair whose writer never stops.
Activity
schizophrenicmaniac commentedon Nov 10, 2026
Hi, I'd like to work on this. I'd shut down the read side of the log sockets in cleanup_sockets_after_kill() before the drain loop, so it only reads what's already queued, and add a supervisor test with a socketpair whose writer never stops.
seanghaeli commentedon Nov 10, 2026
Sure
Stop the socket drain after a kill from waiting on a live writer