mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
fix(mcp): fall back when SIGKILL is unavailable
This commit is contained in:
parent
3e24ba1656
commit
6f63ba9c8f
2 changed files with 41 additions and 1 deletions
|
|
@ -2160,6 +2160,7 @@ def _kill_orphaned_mcp_children() -> None:
|
|||
Only kills PIDs tracked in ``_stdio_pids`` — never arbitrary children.
|
||||
"""
|
||||
import signal as _signal
|
||||
kill_signal = getattr(_signal, "SIGKILL", _signal.SIGTERM)
|
||||
|
||||
with _lock:
|
||||
pids = list(_stdio_pids)
|
||||
|
|
@ -2167,7 +2168,7 @@ def _kill_orphaned_mcp_children() -> None:
|
|||
|
||||
for pid in pids:
|
||||
try:
|
||||
os.kill(pid, _signal.SIGKILL)
|
||||
os.kill(pid, kill_signal)
|
||||
logger.debug("Force-killed orphaned MCP stdio process %d", pid)
|
||||
except (ProcessLookupError, PermissionError, OSError):
|
||||
pass # Already exited or inaccessible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue