removed retry start watcher mechanism

If nodes drop and .watches / .triggered_watches shards are available after those shards were started a new cluster state update will come along that triggers the start watcher logic.

Original commit: elastic/x-pack-elasticsearch@af36f8b078
This commit is contained in:
Martijn van Groningen 2015-06-18 15:48:16 +02:00
parent ca58e93150
commit 7a55a957d3
1 changed files with 5 additions and 23 deletions

View File

@ -78,30 +78,12 @@ public class WatcherLifeCycleService extends AbstractComponent implements Cluste
return;
}
int attempts = 0;
for (; attempts < 3; attempts++) {
try {
if (logger.isDebugEnabled()) {
logger.debug("start attempt [{}]...", attempts);
} else if (logger.isTraceEnabled()) {
logger.trace("starting... (attempt [{}] - based on cluster state version [{}])", attempts, state.getVersion());
}
watcherService.start(state);
return;
} catch (Exception e) {
logger.warn("error occurred while starting, retrying...", e);
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
if (!clusterService.localNode().masterNode()) {
logger.error("abort retry, we are no longer master");
return;
}
}
logger.trace("starting... (based on cluster state version [{}])", state.getVersion());
try {
watcherService.start(state);
} catch (Exception e) {
logger.debug("failed to start watcher. please wait for the cluster to become ready or try to start Watcher manually");
}
logger.error("failed to start watcher. attempted to start [{}] times. please try to start Watcher manually", attempts);
}
@Override