Commit 859e043
Baudbot
Fix: Aggressively kill all bridge processes on startup
Prevent port 7890 conflicts by killing ALL bridge processes (not just
port holders) during startup-pi.sh cleanup. This fixes the common
failure mode where:
1. Control-agent restarts and gets a new session ID
2. Runs startup-pi.sh which kills the tmux session
3. But a bridge process survives (detached/zombied/wrong session tree)
4. Old process holds port 7890, new bridge crash-loops
The new cleanup strategy:
- Kill tmux session (stops restart loop)
- Kill ALL node (broker-)?bridge.mjs processes with SIGTERM
- Wait 3s for graceful exit, then SIGKILL stragglers
- Final safety check: kill anything still on port 7890
This is more aggressive than the old approach but necessary to prevent
orphaned bridge processes after agent restarts.1 parent f60ad4f commit 859e043
1 file changed
Lines changed: 22 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | | - | |
111 | | - | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
| |||
0 commit comments