AMashenkov commented on a change in pull request #8842:
URL: https://github.com/apache/ignite/pull/8842#discussion_r586245551
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionServiceImpl.java
##########
@@ -842,15 +843,31 @@ 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());
+ }
+ catch (Throwable ex) {
+ try {
+ exchangeSvc.sendError(nodeId, msg.queryId(), msg.fragmentId(),
ex);
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Error occurred during send error message: " +
X.getFullStackTrace(e));
+ }
- executeFragment(msg.queryId(), plan, pctx, msg.fragmentDescription());
+ throw ex;
Review comment:
```suggestion
/*
* No exceptions are rethrown here to preserve the current
thread from being destroyed,
* because other queries may be pinned to the current
thread id.
* However, unrecoverable errors must be processed by
FailureHandler.
*/
uncaughtException(Thread.currentThread(), e);
```
----------------------------------------------------------------
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]