mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 05:25:00 +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):
|
||||
# Async case.
|
||||
loop = self.output_socket._get_loop()
|
||||
asyncio.get_running_loop()
|
||||
loop = self.output_queue_task._loop \
|
||||
if self.output_queue_task else None
|
||||
|
||||
sockets = (self.output_socket, self.input_socket,
|
||||
self.first_req_send_socket, self.first_req_rcv_socket,
|
||||
self.stats_update_socket)
|
||||
@ -359,11 +360,12 @@ class BackgroundResources:
|
||||
close_sockets(sockets)
|
||||
for task in tasks:
|
||||
if task is not None and not task.done():
|
||||
with contextlib.suppress(Exception):
|
||||
task.cancel()
|
||||
|
||||
if in_loop(loop):
|
||||
close_sockets_and_tasks()
|
||||
elif not loop.is_closed():
|
||||
elif loop and not loop.is_closed():
|
||||
loop.call_soon_threadsafe(close_sockets_and_tasks)
|
||||
else:
|
||||
# Loop has been closed, try to clean up directly.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user