From fea35d630d528f84487cb3e01df92f55d9c1aaf1 Mon Sep 17 00:00:00 2001 From: Calvin Kirs Date: Tue, 26 Sep 2023 12:05:46 +0800 Subject: [PATCH] [Fix](Job)Job Task does not display error message Job log should record exception stack and jobid --- .../java/org/apache/doris/scheduler/disruptor/TaskHandler.java | 2 +- .../org/apache/doris/scheduler/executor/SqlJobExecutor.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/scheduler/disruptor/TaskHandler.java b/fe/fe-core/src/main/java/org/apache/doris/scheduler/disruptor/TaskHandler.java index 3056502e86e2821..b9c7196e23b0d40 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/scheduler/disruptor/TaskHandler.java +++ b/fe/fe-core/src/main/java/org/apache/doris/scheduler/disruptor/TaskHandler.java @@ -125,7 +125,7 @@ public void onTimerJobTaskHandle(TaskEvent taskEvent) { jobTask.setIsSuccessful(result.isSuccess()); if (!result.isSuccess()) { log.warn("Job execute failed, jobId: {}, msg : {}", jobId, result.getExecutorSql()); - jobTask.setErrorMsg(result.getExecutorSql()); + jobTask.setErrorMsg(result.getErrorMsg()); timerJobManager.pauseJob(jobId); } jobTask.setExecuteSql(result.getExecutorSql()); diff --git a/fe/fe-core/src/main/java/org/apache/doris/scheduler/executor/SqlJobExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/scheduler/executor/SqlJobExecutor.java index 5441532142bc7eb..3df2a6fd9a2de92 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/scheduler/executor/SqlJobExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/scheduler/executor/SqlJobExecutor.java @@ -36,7 +36,6 @@ /** * we use this executor to execute sql job - * */ @Slf4j public class SqlJobExecutor implements JobExecutor { @@ -71,7 +70,7 @@ public ExecutorResult execute(Job job) throws JobException { return new ExecutorResult<>(result, true, null, sql); } catch (Exception e) { - log.warn("execute sql job failed, sql: {}, error: {}", sql, e.getMessage()); + log.warn("execute sql job failed, job id :{}, sql: {}, error: {}", job.getJobId(), sql, e); return new ExecutorResult<>(null, false, e.getMessage(), sql); }