Skip to content

fix: abort process reader/waiter tasks on cleanup to prevent hang#110

Merged
jbj338033 merged 4 commits into
mainfrom
fix/process-registry-task-lifecycle
Jul 7, 2026
Merged

fix: abort process reader/waiter tasks on cleanup to prevent hang#110
jbj338033 merged 4 commits into
mainfrom
fix/process-registry-task-lifecycle

Conversation

@jbj338033

Copy link
Copy Markdown
Collaborator

Summary

ProcessRegistry spawned reader/waiter tasks without keeping their JoinHandles, so if a group kill raced or missed, a leaked child kept those tasks (and its inherited stdout/stderr pipes) alive — stalling process shutdown. This was the root cause of the intermittent 48-minute CI hang on test (ubuntu-latest) and the Windows stdin_write_reaches_process failure (findstr never echoes until stdin EOF).

Task handles are now stored on Entry and aborted on drop; kill also closes stdin to send EOF; shutdown_all drains entries to guarantee cleanup. Adds shutdown_all_terminates_running_processes as a regression test.

Verification

  • cargo test -p goat-agent — passed (110 tests)
  • cargo clippy --workspace --all-targets -- -D warnings — passed
  • cargo fmt --all --check — passed
  • no orphan sleep 30 processes after kill/shutdown tests — verified

@jbj338033 jbj338033 merged commit 71ffb87 into main Jul 7, 2026
4 of 5 checks passed
@jbj338033 jbj338033 deleted the fix/process-registry-task-lifecycle branch July 7, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant