yiguolei commented on code in PR #27969:
URL: https://github.com/apache/doris/pull/27969#discussion_r1416546462
##########
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:
It will never be null 啊
##########
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:
It will never be null 啊
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]