Commit 1ee2cd8
committed
fix(hermes-adapter): kill old bridge process on reconnect to prevent zombie accumulation
When the MemOS bridge fails to initialize (e.g., stuck on orphan recovery
due to external API rate limiting), _reconnect_bridge() would call close()
on the old bridge — which only closes stdin without killing the process.
The old process, stuck in its init loop, never reads stdin EOF and lives
forever. Each failed reconnect cycle spawned new node processes,
accumulating zombies until OOM killer was invoked.
Changes:
- bridge_client.py: add terminate() method (SIGKILL + wait)
- __init__.py: call old_bridge.terminate() during reconnect1 parent e0ef84d commit 1ee2cd8
2 files changed
Lines changed: 17 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
1644 | 1649 | | |
1645 | 1650 | | |
1646 | 1651 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
221 | 233 | | |
222 | 234 | | |
223 | 235 | | |
| |||
0 commit comments