[logging] don't log an error if scheduled reroute is rejected because local node is no longer master

Since it runs in a background thread after a node is added, or submits a cluster state update when a node leaves, it may be that by the time it is executed the local node is no longer master.
This commit is contained in:
Boaz Leskes 2014-07-15 11:46:34 +02:00
parent e0543b3426
commit 7fa3d7081b
1 changed files with 4 additions and 2 deletions

View File

@ -151,8 +151,10 @@ public class RoutingService extends AbstractLifecycleComponent<RoutingService> i
@Override @Override
public void onFailure(String source, Throwable t) { public void onFailure(String source, Throwable t) {
ClusterState state = clusterService.state(); if (!(t instanceof ClusterService.NoLongerMasterException)) {
logger.error("unexpected failure during [{}], current state:\n{}", t, source, state.prettyPrint()); ClusterState state = clusterService.state();
logger.error("unexpected failure during [{}], current state:\n{}", t, source, state.prettyPrint());
}
} }
}); });
routingTableDirty = false; routingTableDirty = false;