Skip to content

Commit 80e5be6

Browse files
committed
fix - force kill parent when frontend not start ok but receive kill signal
1 parent f9aca36 commit 80e5be6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rtp_llm/test/utils/maga_server_manager.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,15 @@ def stop_server(self):
197197
for child in alive:
198198
child.kill() # 强制终止未退出的进程
199199
parent.terminate()
200-
parent.wait()
200+
# 添加超时机制,避免永久阻塞
201+
try:
202+
parent.wait(timeout=10)
203+
except psutil.TimeoutExpired:
204+
logging.warning(
205+
"Parent process did not exit gracefully, force killing"
206+
)
207+
parent.kill()
208+
parent.wait(timeout=5)
201209
self._server_process = None
202210
except Exception as e:
203211
logging.warning("failed to get process with: " + str(e))

0 commit comments

Comments
 (0)