SaintBacchus commented on code in PR #17837:
URL: https://github.com/apache/doris/pull/17837#discussion_r1138392954


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java:
##########
@@ -652,16 +644,33 @@ public String getCurrentConnectedFEIp() {
         return currentConnectedFEIp;
     }
 
+    /**
+     * Keep it just for directly controlling kill_thread_timeout in {@link 
#checkTimeout(long)}
+     */
     public void setExecTimeout(int timeout) {
         executionTimeoutS = timeout;
     }
 
-    public long resetExecTimeoutByInsert() {
-        executionTimeoutS = Math.max(executionTimeoutS, 
sessionVariable.getInsertTimeoutS());
-        return executionTimeoutS;
-    }
-
+    /**
+     * We calculate and get the exact execution timeout here, rather than 
setting
+     * execution timeout in many other places.
+     *
+     * @return exact execution timeout
+     */
     public int getExecTimeout() {
+        if (env != null) {
+            userQueryTimeout = env.getAuth().getQueryTimeout(qualifiedUser);
+        }
+        if (userQueryTimeout > 0) {
+            // user-set query-timeout, has the highest priority
+            executionTimeoutS = (int) userQueryTimeout;
+        } else if (executor.isInsertStmt()) {

Review Comment:
   check null of `executor `



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