Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vllm/v1/engine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,7 @@ def run_engine_core(*args, dp_rank: int = 0, local_dp_rank: int = 0, **kwargs):

engine_core: EngineCoreProc | None = None
signal_callback: SignalCallback | None = None
exitcode = 0
try:
vllm_config: VllmConfig = kwargs["vllm_config"]
parallel_config: ParallelConfig = vllm_config.parallel_config
Expand Down Expand Up @@ -1104,6 +1105,7 @@ def signal_handler(signum, frame):
logger.debug("EngineCore exiting.")
raise
except Exception as e:
exitcode = 1
if engine_core is None:
logger.exception("EngineCore failed to start.")
else:
Expand All @@ -1117,6 +1119,12 @@ def signal_handler(signum, frame):
signal_callback.stop()
if engine_core is not None:
engine_core.shutdown()
# Use os._exit() to terminate this subprocess immediately
# after cleanup. This skips Python's threading._shutdown()
# which can hang indefinitely when third-party libraries
# (e.g., httpx from huggingface-hub >= 1.7) create
# non-daemon background threads that block interpreter exit.
os._exit(exitcode)

def _init_data_parallel(self, vllm_config: VllmConfig):
pass
Expand Down