[CI] Fix mypy for vllm/v1/core and vllm/v1/engine (#27108)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2025-10-30 11:32:17 +00:00
committed by GitHub
parent c7d2a554ba
commit c01f6e525f
12 changed files with 91 additions and 61 deletions
+7 -7
View File
@@ -385,10 +385,11 @@ class BackgroundResources:
with contextlib.suppress(Exception):
task.cancel()
if in_loop(loop):
close_sockets_and_tasks()
elif loop and not loop.is_closed():
loop.call_soon_threadsafe(close_sockets_and_tasks)
if loop is not None:
if in_loop(loop):
close_sockets_and_tasks()
elif not loop.is_closed():
loop.call_soon_threadsafe(close_sockets_and_tasks)
else:
# Loop has been closed, try to clean up directly.
del tasks
@@ -1044,6 +1045,7 @@ class DPAsyncMPClient(AsyncMPClient):
return
assert self.stats_update_address is not None
stats_addr: str = self.stats_update_address
assert len(self.engine_ranks_managed) > 0
# NOTE: running and waiting counts are all global from
# the Coordinator include all global EngineCores. This
@@ -1054,9 +1056,7 @@ class DPAsyncMPClient(AsyncMPClient):
async def run_engine_stats_update_task():
with (
make_zmq_socket(
self.ctx, self.stats_update_address, zmq.XSUB, linger=0
) as socket,
make_zmq_socket(self.ctx, stats_addr, zmq.XSUB, linger=0) as socket,
make_zmq_socket(
self.ctx, self.first_req_sock_addr, zmq.PAIR, bind=False, linger=0
) as first_req_rcv_socket,