Skip to content

Commit 7939233

Browse files
committed
[BugFix] Avoid secondary missing MultiprocExecutor.workers error
If V1 MultiprocExecutor fails during startup before the workers field has been set it will result in secondary confusing exceptions: 'MultiprocExecutor' object has no attribute 'workers' Signed-off-by: Nick Hill <nhill@redhat.com>
1 parent 646a31e commit 7939233

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vllm/v1/executor/multiproc_executor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ def shutdown(self):
258258
self.io_thread_pool.shutdown(wait=False, cancel_futures=True)
259259
self.io_thread_pool = None
260260

261-
for w in self.workers:
262-
w.worker_response_mq = None
263-
self._ensure_worker_termination([w.proc for w in self.workers])
261+
if workers := getattr(self, 'workers', None):
262+
for w in workers:
263+
w.worker_response_mq = None
264+
self._ensure_worker_termination([w.proc for w in workers])
264265

265266
self.rpc_broadcast_mq = None
266267

0 commit comments

Comments
 (0)