korlov42 commented on a change in pull request #8842:
URL: https://github.com/apache/ignite/pull/8842#discussion_r585617292



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionServiceImpl.java
##########
@@ -842,15 +843,29 @@ private boolean single(SqlNode sqlNode) {
     private void onMessage(UUID nodeId, QueryStartRequest msg) {
         assert nodeId != null && msg != null;
 
-        PlanningContext pctx = createContext(Contexts.empty(), 
msg.topologyVersion(), nodeId, msg.schema(), msg.root(), msg.parameters());
+        try {
+            PlanningContext pctx = createContext(Contexts.empty(), 
msg.topologyVersion(), nodeId, msg.schema(), msg.root(), msg.parameters());
 
-        List<QueryPlan> qryPlans = queryPlanCache().queryPlan(pctx, new 
CacheKey(pctx.schemaName(), pctx.query()), this::prepareFragment);
+            List<QueryPlan> qryPlans = queryPlanCache().queryPlan(
+                pctx,
+                new CacheKey(pctx.schemaName(), pctx.query()),
+                this::prepareFragment
+            );
 
-        assert qryPlans.size() == 1 && qryPlans.get(0).type() == 
QueryPlan.Type.FRAGMENT;
+            assert qryPlans.size() == 1 && qryPlans.get(0).type() == 
QueryPlan.Type.FRAGMENT;
 
-        FragmentPlan plan = (FragmentPlan)qryPlans.get(0);
+            FragmentPlan plan = (FragmentPlan)qryPlans.get(0);
 
-        executeFragment(msg.queryId(), plan, pctx, msg.fragmentDescription());
+            executeFragment(msg.queryId(), plan, pctx, 
msg.fragmentDescription());
+        }
+        catch (Throwable ex) {
+            try {
+                exchangeSvc.sendError(nodeId, msg.queryId(), msg.fragmentId(), 
ex);

Review comment:
       > It would be ok to skip sending an answer or log an error if 
ExecService is about to stop.
   WDYT?
   
   yes, it absolutely ok. All awaiting queries should be cancelled by 
originator node when NODE_LEFT event will arise. I'd rather log it with debug 
or trace level
   
   > Error (e.g. OOME) should be rethrown to allow FH to kill current node.
   
   sounds legit
   




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to