[BugFix] Avoid error traceback in logs when V1 LLM terminates (#13565)

Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
Nick Hill 2025-02-19 16:49:01 -08:00 committed by GitHub
parent 550d97eb58
commit a4c402a756
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -252,6 +252,7 @@ class SyncMPClient(MPClient):
outputs_queue = self.outputs_queue outputs_queue = self.outputs_queue
def process_outputs_socket(): def process_outputs_socket():
try:
while True: while True:
(frame, ) = output_socket.recv_multipart(copy=False) (frame, ) = output_socket.recv_multipart(copy=False)
outputs = decoder.decode(frame.buffer) outputs = decoder.decode(frame.buffer)
@ -260,6 +261,9 @@ class SyncMPClient(MPClient):
utility_results) utility_results)
else: else:
outputs_queue.put_nowait(outputs) outputs_queue.put_nowait(outputs)
except zmq.error.ContextTerminated:
# Expected when the class is GC'd / during process termination.
pass
# Process outputs from engine in separate thread. # Process outputs from engine in separate thread.
Thread(target=process_outputs_socket, daemon=True).start() Thread(target=process_outputs_socket, daemon=True).start()