Skip to content

Commit a4c402a

Browse files
authored
[BugFix] Avoid error traceback in logs when V1 LLM terminates (#13565)
Signed-off-by: Nick Hill <[email protected]>
1 parent 550d97e commit a4c402a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

vllm/v1/engine/core_client.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,18 @@ def __init__(self, vllm_config: VllmConfig, executor_class: Type[Executor],
252252
outputs_queue = self.outputs_queue
253253

254254
def process_outputs_socket():
255-
while True:
256-
(frame, ) = output_socket.recv_multipart(copy=False)
257-
outputs = decoder.decode(frame.buffer)
258-
if outputs.utility_output:
259-
_process_utility_output(outputs.utility_output,
260-
utility_results)
261-
else:
262-
outputs_queue.put_nowait(outputs)
255+
try:
256+
while True:
257+
(frame, ) = output_socket.recv_multipart(copy=False)
258+
outputs = decoder.decode(frame.buffer)
259+
if outputs.utility_output:
260+
_process_utility_output(outputs.utility_output,
261+
utility_results)
262+
else:
263+
outputs_queue.put_nowait(outputs)
264+
except zmq.error.ContextTerminated:
265+
# Expected when the class is GC'd / during process termination.
266+
pass
263267

264268
# Process outputs from engine in separate thread.
265269
Thread(target=process_outputs_socket, daemon=True).start()

0 commit comments

Comments
 (0)