TangSiyang2001 commented on code in PR #16343:
URL: https://github.com/apache/doris/pull/16343#discussion_r1095824933


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java:
##########
@@ -577,25 +579,30 @@ public void checkTimeout(long now) {
                 killConnection = true;
             }
         } else {
+            long timeout;
             if (userQueryTimeout > 0) {
                 // user set query_timeout property
-                if (delta > userQueryTimeout * 1000) {
-                    LOG.warn("kill query timeout, remote: {}, query timeout: 
{}",
-                            getMysqlChannel().getRemoteHostPortString(), 
userQueryTimeout);
-
-                    killFlag = true;
-                }
+                timeout = userQueryTimeout * 1000;
             } else {
                 // default use session query_timeout
-                if (delta > sessionVariable.getQueryTimeoutS() * 1000) {
-                    LOG.warn("kill query timeout, remote: {}, query timeout: 
{}",
-                            getMysqlChannel().getRemoteHostPortString(), 
sessionVariable.getQueryTimeoutS());
+                timeout = sessionVariable.getQueryTimeoutS() * 1000L;
+            }
 
-                    // Only kill
-                    killFlag = true;
+            //deal with insert stmt particularly
+            if (executor != null) {
+                StatementBase parsedStmt = executor.getParsedStmt();
+                if (parsedStmt instanceof InsertStmt) {
+                    timeout = sessionVariable.getInsertTimeoutS() * 1000L;
                 }
             }
+
+            if (delta > timeout) {
+                LOG.warn("kill query timeout, remote: {}, query timeout: {}",

Review Comment:
   I was negligent, INSERT does need a different log msg. I'll modify it.



-- 
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