[core] do not send error across process (#16174)

Signed-off-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
youkaichao 2025-04-08 10:09:03 +08:00 committed by GitHub
parent 21802c4b6d
commit a865bc1ca6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,10 +119,9 @@ class MultiprocExecutor(Executor):
timeout=dequeue_timeout)
if status != WorkerProc.ResponseStatus.SUCCESS:
if isinstance(result, Exception):
raise result
else:
raise RuntimeError("Worker failed")
raise RuntimeError(
"Worker failed with error %s, please check the"
" stack trace above for the root cause", result)
responses[w.rank] = result
@ -378,9 +377,11 @@ class WorkerProc:
# Notes have been introduced in python 3.11
if hasattr(e, "add_note"):
e.add_note(traceback.format_exc())
self.worker_response_mq.enqueue(
(WorkerProc.ResponseStatus.FAILURE, e))
logger.exception("WorkerProc hit an exception: %s", exc_info=e)
# exception might not be serializable, so we convert it to
# string, only for logging purpose.
self.worker_response_mq.enqueue(
(WorkerProc.ResponseStatus.FAILURE, str(e)))
continue
self.worker_response_mq.enqueue(