Skip to content

Commit

Permalink
[fix](profile) Task state of query profile is not set correctly (#38082)
Browse files Browse the repository at this point in the history
Task state in connection context will only be updated after profile is
updated. So task state of profile should be set to query state of coordinator.
  • Loading branch information
zhiqiang-hhhh authored Jul 23, 2024
1 parent 355ffa5 commit 912a238
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,15 @@ private Map<String, String> getSummaryInfo(boolean isFinished) {
builder.endTime(TimeUtils.longToTimeString(currentTimestamp));
builder.totalTime(DebugUtil.getPrettyStringMs(currentTimestamp - context.getStartTime()));
}
builder.taskState(!isFinished && context.getState().getStateType().equals(MysqlStateType.OK) ? "RUNNING"
: context.getState().toString());
String taskState = "RUNNING";
if (isFinished) {
if (coord != null) {
taskState = coord.queryStatus.getErrorCode().name();
} else {
taskState = context.getState().toString();
}
}
builder.taskState(taskState);
builder.user(context.getQualifiedUser());
builder.defaultDb(context.getDatabase());
builder.workloadGroup(context.getWorkloadGroupName());
Expand Down

0 comments on commit 912a238

Please sign in to comment.