wangbo commented on code in PR #27969:
URL: https://github.com/apache/doris/pull/27969#discussion_r1416536293


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -607,23 +607,28 @@ public void finalizeQuery() {
     private void handleQueryWithRetry(TUniqueId queryId) throws Exception {
         // queue query here
         syncJournalIfNeeded();
-        QueueOfferToken offerRet = null;
+        QueueToken queueToken = null;
         QueryQueue queryQueue = null;
         if (!parsedStmt.isExplain() && Config.enable_workload_group && 
Config.enable_query_queue
                 && context.getSessionVariable().getEnablePipelineEngine()) {
             queryQueue = 
context.getEnv().getWorkloadGroupMgr().getWorkloadGroupQueryQueue(context);
             try {
-                offerRet = queryQueue.offer();
+                queueToken = queryQueue.getToken();
             } catch (InterruptedException e) {
                 // this Exception means try lock/await failed, so no need to 
handle offer result
                 LOG.error("error happens when offer queue, query id=" + 
DebugUtil.printId(queryId) + " ", e);
                 throw new RuntimeException("interrupted Exception happens when 
queue query");
             }
-            if (offerRet != null && !offerRet.isOfferSuccess()) {
-                String retMsg = "queue failed, reason=" + 
offerRet.getOfferResultDetail();
+            if (queueToken != null && !queueToken.enqueueSuccess()) {
+                String retMsg = "queue failed, reason=" + 
queueToken.getOfferResultDetail();
                 LOG.error("query (id=" + DebugUtil.printId(queryId) + ") " + 
retMsg);
                 throw new UserException(retMsg);
             }
+            if (!queueToken.waitSignal()) {

Review Comment:
   if (queueToken != null && !queueToken.waitSignal())



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