[Misc] Print stack trace using logger.exception (#9461)

This commit is contained in:
Cyrus Leung
2024-10-17 13:55:48 +00:00
committed by GitHub
parent e312e52b44
commit 390be74649
8 changed files with 26 additions and 30 deletions
+3 -5
View File
@@ -3,7 +3,6 @@ import multiprocessing
import os
import sys
import threading
import traceback
import uuid
from dataclasses import dataclass
from multiprocessing import Queue
@@ -227,10 +226,9 @@ def _run_worker_process(
except KeyboardInterrupt:
break
except BaseException as e:
tb = traceback.format_exc()
logger.error(
"Exception in worker %s while processing method %s: %s, %s",
process_name, method, e, tb)
logger.exception(
"Exception in worker %s while processing method %s.",
process_name, method)
exception = e
result_queue.put(
Result(task_id=task_id, value=output, exception=exception))