You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "SaintBacchus (via GitHub)" <gi...@apache.org> on 2023/03/16 09:53:17 UTC
[GitHub] [doris] SaintBacchus commented on a diff in pull request #17837: [fix](timeout) fix set query_timeout and insert_timeout failure
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-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org