From ba1c215a012357c621a1839220ee264a4ad7ff22 Mon Sep 17 00:00:00 2001 From: wtingkai <330445001@qq.com> Date: Wed, 6 Aug 2025 17:21:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(OmniAdvisor):=20=E6=8D=95=E6=8D=89?= =?UTF-8?q?=E6=8A=93=E5=8F=96Trace=E8=BF=87=E7=A8=8B=E4=B8=AD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E8=A2=AB=E6=8B=92=E7=BB=9D=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/omniadvisor/service/spark_service/spark_run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/omniadvisor/src/omniadvisor/service/spark_service/spark_run.py b/omniadvisor/src/omniadvisor/service/spark_service/spark_run.py index 403e120eb..146d1e732 100644 --- a/omniadvisor/src/omniadvisor/service/spark_service/spark_run.py +++ b/omniadvisor/src/omniadvisor/service/spark_service/spark_run.py @@ -1,6 +1,6 @@ import multiprocessing import time -from requests.exceptions import HTTPError +from requests.exceptions import HTTPError, ConnectionError from common.constant import OA_CONF from omniadvisor.repository.model.load import Load @@ -116,6 +116,9 @@ def _update_trace_from_history_server(exam_record: ExamRecord, application_id: s time.sleep(OA_CONF.spark_fetch_trace_interval) global_logger.debug(f"Cannot access history server: %s", httpe) continue + except ConnectionError: + # raise from None是为了屏蔽前序异常的堆栈信息 + raise RuntimeError('Connection is refused when fetching trace, please check spark history server.') from None trace_dict['sql'] = save_trace_data(data=trace_sql, data_dir=OA_CONF.data_dir) trace_dict['stages'] = save_trace_data(data=trace_stages, data_dir=OA_CONF.data_dir) trace_dict['executor'] = save_trace_data(data=trace_executor, data_dir=OA_CONF.data_dir) -- Gitee