mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 06:45:01 +08:00
[BugFix] Fix async core engine client finalizer (#24540)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
parent
3c2156b3af
commit
f88e84016f
@ -347,8 +347,9 @@ class BackgroundResources:
|
|||||||
|
|
||||||
if isinstance(self.output_socket, zmq.asyncio.Socket):
|
if isinstance(self.output_socket, zmq.asyncio.Socket):
|
||||||
# Async case.
|
# Async case.
|
||||||
loop = self.output_socket._get_loop()
|
loop = self.output_queue_task._loop \
|
||||||
asyncio.get_running_loop()
|
if self.output_queue_task else None
|
||||||
|
|
||||||
sockets = (self.output_socket, self.input_socket,
|
sockets = (self.output_socket, self.input_socket,
|
||||||
self.first_req_send_socket, self.first_req_rcv_socket,
|
self.first_req_send_socket, self.first_req_rcv_socket,
|
||||||
self.stats_update_socket)
|
self.stats_update_socket)
|
||||||
@ -359,11 +360,12 @@ class BackgroundResources:
|
|||||||
close_sockets(sockets)
|
close_sockets(sockets)
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
if task is not None and not task.done():
|
if task is not None and not task.done():
|
||||||
task.cancel()
|
with contextlib.suppress(Exception):
|
||||||
|
task.cancel()
|
||||||
|
|
||||||
if in_loop(loop):
|
if in_loop(loop):
|
||||||
close_sockets_and_tasks()
|
close_sockets_and_tasks()
|
||||||
elif not loop.is_closed():
|
elif loop and not loop.is_closed():
|
||||||
loop.call_soon_threadsafe(close_sockets_and_tasks)
|
loop.call_soon_threadsafe(close_sockets_and_tasks)
|
||||||
else:
|
else:
|
||||||
# Loop has been closed, try to clean up directly.
|
# Loop has been closed, try to clean up directly.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user