Jackie-Jiang commented on code in PR #17009:
URL: https://github.com/apache/pinot/pull/17009#discussion_r2427571239


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/streaming/StreamingInstanceResponseOperator.java:
##########
@@ -91,11 +90,14 @@ protected InstanceResponseBlock getNextBlock() {
         return 
buildInstanceResponseBlock(resultsBlock).toMetadataOnlyResponseBlock();
       }
     } catch (Throwable t) {
-      TerminationException terminateException = 
QueryThreadContext.getTerminateException();
-      if (terminateException != null) {
-        return new InstanceResponseBlock(new 
ExceptionResultsBlock(terminateException));
-      } else if (t instanceof QueryException) {
-        return new InstanceResponseBlock(new 
ExceptionResultsBlock((QueryException) t));
+      // First check terminate exception and use it as the results block if 
exists. We want to return the termination
+      // reason when query is explicitly terminated.
+      QueryException queryException = 
QueryThreadContext.getTerminateException();

Review Comment:
   Note for reviewer: this has no functionality change, but make the handling 
logic consistent in the following classes: `StreamingInstanceResponseOperator`, 
`BrokerReduceService`, `QueryScheduler`, `QueryRunner`, `MailboxSendOperator`



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

Reply via email to