zhiqiang-hhhh commented on code in PR #31228:
URL: https://github.com/apache/doris/pull/31228#discussion_r1498736708


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ResultReceiver.java:
##########
@@ -71,25 +74,43 @@ public RowBatch getNext(Status status) throws TException {
                         .build();
 
                 currentThread = Thread.currentThread();
-                Future<InternalService.PFetchDataResult> future
+                fetchDataAsyncFuture
                         = 
BackendServiceProxy.getInstance().fetchDataAsync(address, request);
                 InternalService.PFetchDataResult pResult = null;
+
                 while (pResult == null) {
                     long currentTs = System.currentTimeMillis();
                     if (currentTs >= timeoutTs) {
                         throw new TimeoutException("query timeout, query id = 
" + DebugUtil.printId(this.queryId));
                     }
                     try {
-                        pResult = future.get(timeoutTs - currentTs, 
TimeUnit.MILLISECONDS);
+                        pResult = fetchDataAsyncFuture.get(timeoutTs - 
currentTs, TimeUnit.MILLISECONDS);
+                    } catch (CancellationException e) {
+                        LOG.warn("Future of ResultReceiver of query {} is 
cancelled", DebugUtil.printId(this.queryId));
+                        if (!isCancel) {
+                            LOG.warn("ResultReceiver is not set to cancelled 
state, this should not happen");
+                        } else {
+                            status.setStatus(new Status(TStatusCode.CANCELLED, 
this.cancelReason));
+                            return null;
+                        }
+                    } catch (TimeoutException e) {
+                        LOG.warn("Query {} get result timeout, get result 
duration {} ms",
+                                DebugUtil.printId(this.queryId), (timeoutTs - 
currentTs)/1000);
+                        isCancel = true;
+                        status.setStatus(Status.TIMEOUT);
+                        updateCancelReason("Fetch date timeout");

Review Comment:
   done



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