You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/10/31 18:01:06 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9689: Handle errors in combine operator

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


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/combine/BaseCombineOperator.java:
##########
@@ -105,10 +105,14 @@ public void runJob() {
             processSegments();
           } catch (EarlyTerminationException e) {
             // Early-terminated by interruption (canceled by the main thread)
-          } catch (Exception e) {
-            // Caught exception, skip processing the remaining segments
-            LOGGER.error("Caught exception while processing query: " + _queryContext, e);
-            onException(e);
+          } catch (Throwable t) {
+            // Caught exception/error, skip processing the remaining segments
+            if (t instanceof Exception) {
+              LOGGER.error("Caught exception while processing query: " + _queryContext, t);
+            } else {
+              LOGGER.error("Caught serious error while processing query: " + _queryContext, t);

Review Comment:
   Usually Java doesn't want user code to catch the `Error` which indicates some serious problems (see `Error.java` for more details). But for our specific case, we need to catch them in the sub-thread, or the thread will die without inserting the exceptions, and can cause unexpected behavior. Will add some comments



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org