|
21 | 21 |
|
22 | 22 | import org.apache.iotdb.calc.exception.QueryProcessException; |
23 | 23 | import org.apache.iotdb.calc.execution.operator.Operator; |
| 24 | +import org.apache.iotdb.commons.exception.MetadataLeaseFencedException; |
24 | 25 | import org.apache.iotdb.db.i18n.DataNodeQueryMessages; |
| 26 | +import org.apache.iotdb.db.i18n.DataNodeSchemaMessages; |
25 | 27 | import org.apache.iotdb.db.queryengine.execution.operator.source.DataSourceOperator; |
26 | 28 | import org.apache.iotdb.db.queryengine.plan.planner.plan.FragmentInstance; |
27 | 29 | import org.apache.iotdb.db.storageengine.dataregion.read.IQueryDataSource; |
@@ -65,21 +67,29 @@ protected boolean init(SettableFuture<?> blockedFuture) { |
65 | 67 | } else { |
66 | 68 | return true; |
67 | 69 | } |
| 70 | + } catch (MetadataLeaseFencedException e) { |
| 71 | + LOGGER.info( |
| 72 | + DataNodeSchemaMessages.METADATA_LEASE_IS_FENCED, driverContext.getDriverTaskID(), e); |
| 73 | + handleInitFailure(e, blockedFuture); |
68 | 74 | } catch (Throwable t) { |
69 | 75 | LOGGER.error( |
70 | 76 | DataNodeQueryMessages.FAILED_TO_DO_THE_INITIALIZATION_FOR_DRIVER_ARG, |
71 | 77 | driverContext.getDriverTaskID(), |
72 | 78 | t); |
73 | | - driverContext.failed(t); |
74 | | - blockedFuture.setException(t); |
75 | | - throwIfUnchecked(t); |
76 | | - // should never happen |
77 | | - throw new AssertionError(t); |
| 79 | + handleInitFailure(t, blockedFuture); |
78 | 80 | } |
79 | 81 | } |
80 | 82 | return true; |
81 | 83 | } |
82 | 84 |
|
| 85 | + private void handleInitFailure(Throwable t, SettableFuture<?> blockedFuture) { |
| 86 | + driverContext.failed(t); |
| 87 | + blockedFuture.setException(t); |
| 88 | + throwIfUnchecked(t); |
| 89 | + // should never happen |
| 90 | + throw new AssertionError(t); |
| 91 | + } |
| 92 | + |
83 | 93 | @Override |
84 | 94 | public boolean isInit() { |
85 | 95 | return init; |
|
0 commit comments