The session run loop closes the PTY after copyOut returns, and session.close (via Manager.Close) closes the same PTY again. creackPTY.Close called cmd.Wait each time, and a second concurrent Wait on the same process blocks forever, so daemon shutdown deadlocked whenever a terminal was still attached. fakePTY is idempotent via sync.Once, so the unit suite never exercised this; a real tmux attach surfaced it. Guard close+kill+wait with a sync.Once so Wait runs exactly once. Add a regression test that double-closes a real PTY under a watchdog. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| adapters | ||
| cdc | ||
| config | ||
| domain | ||
| httpd | ||
| lifecycle | ||
| observe/reaper | ||
| ports | ||
| runfile | ||
| session | ||
| storage/sqlite | ||
| terminal | ||