Commit 0704a0b
committed
fix: prevent orphaned processes via stdin/ppid/onclose lifecycle guards
Adds 4 missing lifecycle guards to main() that caused orphaned node
processes to accumulate (~27GB RAM from 41 orphans on a 32GB machine):
- stdin end/close listeners: detect client exit via pipe closure
- server.onclose: handle graceful MCP protocol disconnect
- PPID polling (5s, unref'd): cross-platform parent death detection
- SIGHUP handler: terminal close on Unix + Windows console close1 parent a814b24 commit 0704a0b
1 file changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1612 | 1612 | | |
1613 | 1613 | | |
1614 | 1614 | | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
1615 | 1629 | | |
1616 | 1630 | | |
1617 | 1631 | | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1618 | 1641 | | |
1619 | 1642 | | |
1620 | 1643 | | |
| |||
1651 | 1674 | | |
1652 | 1675 | | |
1653 | 1676 | | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1654 | 1681 | | |
1655 | 1682 | | |
1656 | 1683 | | |
| |||
0 commit comments