morningman commented on a change in pull request #6358:
URL: https://github.com/apache/incubator-doris/pull/6358#discussion_r696710401



##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
##########
@@ -576,7 +577,8 @@ private void sendFragment() throws TException, 
RpcException, UserException {
                         
cancelInternal(InternalService.PPlanFragmentCancelReason.INTERNAL_ERROR);
                         switch (code) {
                             case TIMEOUT:
-                                throw new UserException("query timeout. 
backend id: " + pair.first.backend.getId());
+                                throw new 
UserException(InternalErrorCode.TIMEOUT_ERR,
+                                        "query timeout. backend id: " + 
pair.first.backend.getId());

Review comment:
       ```suggestion
                                           "send fragment timeout. backend id: 
" + pair.first.backend.getId());
   ```
   And this is not a normal `query timeout`, The timeout of sending fragment 
should be treated as an internal error.
   Maybe we should add a new error code for this.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
##########
@@ -124,10 +125,19 @@ private void auditAfterExec(String origStmt, 
StatementBase parsedStmt, Data.PQue
 
         if (ctx.getState().isQuery()) {
             MetricRepo.COUNTER_QUERY_ALL.increase(1L);
-            if (ctx.getState().getStateType() == QueryState.MysqlStateType.ERR
-                    && ctx.getState().getErrType() != 
QueryState.ErrType.ANALYSIS_ERR) {
-                // err query
-                MetricRepo.COUNTER_QUERY_ERR.increase(1L);
+            if (ctx.getState().getStateType() == 
QueryState.MysqlStateType.ERR) {
+                InternalErrorCode errorCode = 
ctx.getState().getInternalErrorCode();
+                if (errorCode == InternalErrorCode.INTERNAL_ERR) {
+                    // err query
+                    MetricRepo.COUNTER_QUERY_ERR.increase(1L);
+                } else {
+                    MetricRepo.COUNTER_QUERY_ERR_OTHER.increase(1L);
+                    MetricRepo.HISTO_QUERY_LATENCY.update(elapseMs);

Review comment:
       Agree




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to