fix #2012 set maxEsStatusRetry to 60

This commit is contained in:
Shinsuke Sugaya 2019-02-09 22:24:52 +09:00
parent 0665940b1d
commit 07d88fd513

View file

@ -183,7 +183,7 @@ public class FessEsClient implements Client {
protected int maxConfigSyncStatusRetry = 10;
protected int maxEsStatusRetry = 10;
protected int maxEsStatusRetry = 60;
protected String clusterName = "elasticsearch";
@ -566,6 +566,7 @@ public class FessEsClient implements Client {
protected void waitForYellowStatus(final FessConfig fessConfig) {
Exception cause = null;
final long startTime = System.currentTimeMillis();
for (int i = 0; i < maxEsStatusRetry; i++) {
try {
final ClusterHealthResponse response =
@ -589,7 +590,8 @@ public class FessEsClient implements Client {
}
final String message =
"Elasticsearch (" + System.getProperty(Constants.FESS_ES_HTTP_ADDRESS)
+ ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ").";
+ ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ") in "
+ (System.currentTimeMillis() - startTime) + "ms.";
throw new ContainerInitFailureException(message, cause);
}