mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-19 21:34:27 +08:00
[V1] Avoid socket errors during shutdown when requests are in in-flight (#16807)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
parent
047797ef90
commit
b2f195c429
@ -384,7 +384,7 @@ class EngineCoreProc(EngineCore):
|
|||||||
|
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
logger.debug("EngineCore exiting.")
|
logger.debug("EngineCore exiting.")
|
||||||
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if engine_core is None:
|
if engine_core is None:
|
||||||
logger.exception("EngineCore failed to start.")
|
logger.exception("EngineCore failed to start.")
|
||||||
|
|||||||
@ -312,6 +312,7 @@ class BackgroundResources:
|
|||||||
def __call__(self):
|
def __call__(self):
|
||||||
"""Clean up background resources."""
|
"""Clean up background resources."""
|
||||||
|
|
||||||
|
self.engine_dead = True
|
||||||
for core_engine in self.core_engines:
|
for core_engine in self.core_engines:
|
||||||
core_engine.close()
|
core_engine.close()
|
||||||
|
|
||||||
@ -564,7 +565,7 @@ class SyncMPClient(MPClient):
|
|||||||
self._send_input(EngineCoreRequestType.ADD, request)
|
self._send_input(EngineCoreRequestType.ADD, request)
|
||||||
|
|
||||||
def abort_requests(self, request_ids: list[str]) -> None:
|
def abort_requests(self, request_ids: list[str]) -> None:
|
||||||
if len(request_ids) > 0:
|
if request_ids and not self.resources.engine_dead:
|
||||||
self._send_input(EngineCoreRequestType.ABORT, request_ids)
|
self._send_input(EngineCoreRequestType.ABORT, request_ids)
|
||||||
|
|
||||||
def profile(self, is_start: bool = True) -> None:
|
def profile(self, is_start: bool = True) -> None:
|
||||||
@ -735,7 +736,7 @@ class AsyncMPClient(MPClient):
|
|||||||
self._ensure_output_queue_task()
|
self._ensure_output_queue_task()
|
||||||
|
|
||||||
async def abort_requests_async(self, request_ids: list[str]) -> None:
|
async def abort_requests_async(self, request_ids: list[str]) -> None:
|
||||||
if len(request_ids) > 0:
|
if request_ids and not self.resources.engine_dead:
|
||||||
await self._send_input(EngineCoreRequestType.ABORT, request_ids)
|
await self._send_input(EngineCoreRequestType.ABORT, request_ids)
|
||||||
|
|
||||||
async def profile_async(self, is_start: bool = True) -> None:
|
async def profile_async(self, is_start: bool = True) -> None:
|
||||||
@ -902,5 +903,6 @@ class DPAsyncMPClient(AsyncMPClient):
|
|||||||
|
|
||||||
async def _abort_requests(self, request_ids: list[str],
|
async def _abort_requests(self, request_ids: list[str],
|
||||||
engine: CoreEngine) -> None:
|
engine: CoreEngine) -> None:
|
||||||
await self._send_input(EngineCoreRequestType.ABORT, request_ids,
|
if not self.resources.engine_dead:
|
||||||
engine)
|
await self._send_input(EngineCoreRequestType.ABORT, request_ids,
|
||||||
|
engine)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user