This is an automated email from the ASF dual-hosted git repository.

lihaopeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 912a23887fc [fix](profile) Task state of query profile is not set 
correctly (#38082)
912a23887fc is described below

commit 912a23887fcae26c34ff6d03ad76bd221e44c5c8
Author: zhiqiang <seuhezhiqi...@163.com>
AuthorDate: Tue Jul 23 15:29:45 2024 +0800

    [fix](profile) Task state of query profile is not set correctly (#38082)
    
    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.
---
 .../src/main/java/org/apache/doris/qe/StmtExecutor.java       | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index af141ff8d12..681f659b1a2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -387,8 +387,15 @@ public class StmtExecutor {
             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());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to