Notify Listener if transport throws an exception

This commit is contained in:
Simon Willnauer 2015-05-20 11:23:12 +02:00
parent 5e4d5e1c64
commit 44b0edd2b8
1 changed files with 34 additions and 30 deletions

View File

@ -191,6 +191,7 @@ public class SyncedFlushService extends AbstractComponent {
* 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) {
try {
final ShardRouting primaryShard = shardRoutingTable.primaryShard();
final DiscoveryNode primaryNode = state.nodes().get(primaryShard.currentNodeId());
if (primaryNode == null) {
@ -222,6 +223,9 @@ public class SyncedFlushService extends AbstractComponent {
return ThreadPool.Names.SAME;
}
});
} catch (Throwable t) {
listener.onFailure(t);
}
}