From e73167ade38c93969ae67ad36047eb20c08ba649 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Fri, 14 Mar 2025 15:12:26 -0700 Subject: [PATCH] Fix maximum recursion depth triggered on exception exit (#4438) --- python/sglang/srt/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/sglang/srt/utils.py b/python/sglang/srt/utils.py index b661d648f..1ba9f38f7 100644 --- a/python/sglang/srt/utils.py +++ b/python/sglang/srt/utils.py @@ -527,6 +527,9 @@ def kill_process_tree(parent_pid, include_parent: bool = True, skip_pid: int = N pass if include_parent: + if parent_pid == os.getpid(): + sys.exit(0) + try: itself.kill()