yiguolei commented on code in PR #37559: URL: https://github.com/apache/doris/pull/37559#discussion_r1675374613
########## fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/QueryQueue.java: ########## @@ -105,18 +104,31 @@ public QueueToken getToken() throws UserException { if (LOG.isDebugEnabled()) { LOG.info(this.debugString()); } - if (currentRunningQueryNum < maxConcurrency) { + AdmissionControl admissionControl = Env.getCurrentEnv().getAdmissionControl(); + boolean isMemEnough = admissionControl.isAllBeMemoryEnough(); + boolean isReachMaxCon = runningQueryQueue.size() >= maxConcurrency; + if (!isReachMaxCon && isMemEnough) { QueueToken retToken = new QueueToken(TokenState.READY_TO_RUN, queueTimeout, this); + runningQueryQueue.offer(retToken); retToken.complete(); - currentRunningQueryNum++; return retToken; } - if (priorityTokenQueue.size() >= maxQueueSize) { + if (maxQueueSize > 0 && waitingQueryQueue.size() >= maxQueueSize) { throw new UserException("query waiting queue is full, queue length=" + maxQueueSize); } - QueueToken newQueryToken = new QueueToken(TokenState.ENQUEUE_SUCCESS, queueTimeout, - this); - this.priorityTokenQueue.offer(newQueryToken); + + QueueToken newQueryToken = new QueueToken(TokenState.ENQUEUE_SUCCESS, queueTimeout, this); + String queueMsg = "WAIT_IN_QUEUE"; + if (!isReachMaxCon && !isMemEnough) { + queueMsg = "WAIT_BE_MEMORY"; Review Comment: 这个message 应该是adminssion control 在check resource的时候,同时设置的。 -- 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