Crash the server correctly during error (#2231)

This commit is contained in:
Lianmin Zheng
2024-11-28 00:22:39 -08:00
committed by GitHub
parent db674e3d24
commit d4fc1a70e3
46 changed files with 147 additions and 139 deletions

View File

@@ -47,6 +47,7 @@ import itertools
import json
import logging
import multiprocessing
import os
import time
from typing import Tuple
@@ -62,11 +63,7 @@ from sglang.srt.model_executor.model_runner import ModelRunner
from sglang.srt.sampling.sampling_params import SamplingParams
from sglang.srt.server import _set_envs_and_config
from sglang.srt.server_args import PortArgs, ServerArgs
from sglang.srt.utils import (
configure_logger,
kill_child_process,
suppress_other_loggers,
)
from sglang.srt.utils import configure_logger, kill_process_tree, suppress_other_loggers
@dataclasses.dataclass
@@ -468,4 +465,4 @@ if __name__ == "__main__":
main(server_args, bench_args)
finally:
if server_args.tp_size != 1:
kill_child_process()
kill_process_tree(os.getpid(), include_parent=False)