{"record":{"id":"e25d878b79461e7b","repo":"sgl-project/sglang","slug":"server-process-exited","errorCode":null,"errorMessage":"Server process exited","messagePattern":"Server process exited","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"python/sglang/utils.py","lineNumber":548,"sourceCode":"    lock_socket = process_socket_map.pop(process, None)\n    if lock_socket is not None:\n        release_port(lock_socket)\n\n\ndef _raise_if_process_exited(process: Optional[Any]) -> None:\n    if process is None:\n        return\n\n    if hasattr(process, \"poll\"):\n        return_code = process.poll()\n        if return_code is not None:\n            raise RuntimeError(f\"Server process exited with code {return_code}\")\n        return\n\n    if hasattr(process, \"is_alive\") and not process.is_alive():\n        return_code = getattr(process, \"exitcode\", None)\n        if return_code is None:\n            raise RuntimeError(\"Server process exited\")\n        raise RuntimeError(f\"Server process exited with code {return_code}\")\n\n\ndef _is_wait_timeout(start_time: float, timeout: Optional[int]) -> bool:\n    if timeout is None:\n        return False\n    return time.perf_counter() - start_time > timeout\n\n\ndef wait_for_http_ready(\n    url: str,\n    timeout: Optional[int] = None,\n    process: Optional[Any] = None,\n    headers: Optional[dict] = None,\n    request_timeout: int = 5,\n) -> None:\n    \"\"\"Wait for an HTTP endpoint to return status 200.\"\"\"\n    start_time = time.perf_counter()","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/utils.py#L530-L566","documentation":"_raise_if_process_exited found the process (multiprocessing-style, has is_alive) is dead but exitcode is None — it terminated abnormally (e.g. SIGKILL) without an exit code, so only a generic 'Server process exited' can be reported.","triggerScenarios":"Server process killed by SIGKILL (OOM killer, manual kill -9) while wait_for_http_ready polls; exitcode attribute missing or None.","commonSituations":"OOM killer reaping the server in memory-tight CI; container memory limits; manual kills during debugging.","solutions":["Check dmesg/container logs for OOM kills and raise the memory limit","Inspect server logs for the abrupt-termination cause","Retry with reduced memory usage (smaller --mem-fraction-static, shorter context)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    wait_for_http_ready(proc, url)\nexcept RuntimeError as e:\n    if 'Server process exited' in str(e):\n        check_oom_logs(); raise","preventionTips":["Watch memory limits; exitcode None usually means SIGKILL/OOM","Set container memory limits above server peak usage"],"tags":["server","lifecycle","oom","subprocess"],"backgroundTag":"server-process-killed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}