Notify Listener if transport throws an exception
This commit is contained in:
parent
5e4d5e1c64
commit
44b0edd2b8
|
@ -191,6 +191,7 @@ public class SyncedFlushService extends AbstractComponent {
|
||||||
* returns the number of inflight operations on primary. -1 upon error.
|
* returns the number of inflight operations on primary. -1 upon error.
|
||||||
*/
|
*/
|
||||||
protected void getInflightOpsCount(final ShardId shardId, ClusterState state, IndexShardRoutingTable shardRoutingTable, final ActionListener<InFlightOpsResponse> listener) {
|
protected void getInflightOpsCount(final ShardId shardId, ClusterState state, IndexShardRoutingTable shardRoutingTable, final ActionListener<InFlightOpsResponse> listener) {
|
||||||
|
try {
|
||||||
final ShardRouting primaryShard = shardRoutingTable.primaryShard();
|
final ShardRouting primaryShard = shardRoutingTable.primaryShard();
|
||||||
final DiscoveryNode primaryNode = state.nodes().get(primaryShard.currentNodeId());
|
final DiscoveryNode primaryNode = state.nodes().get(primaryShard.currentNodeId());
|
||||||
if (primaryNode == null) {
|
if (primaryNode == null) {
|
||||||
|
@ -222,6 +223,9 @@ public class SyncedFlushService extends AbstractComponent {
|
||||||
return ThreadPool.Names.SAME;
|
return ThreadPool.Names.SAME;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} catch (Throwable t) {
|
||||||
|
listener.onFailure(t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue