diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java index 95f6bc136d2..32d608e385f 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java @@ -300,7 +300,7 @@ public final class RestClient implements Closeable { listener.onSuccess(response); } else { ResponseException responseException = new ResponseException(response); - if (mustRetry(statusCode)) { + if (mayRetry(statusCode)) { //mark host dead and retry against next one onFailure(host); retryIfPossible(responseException, hosts, request); @@ -437,7 +437,7 @@ public final class RestClient implements Closeable { return statusCode < 300 || (HttpHead.METHOD_NAME.equals(method) && statusCode == 404); } - private static boolean mustRetry(int statusCode) { + private static boolean mayRetry(int statusCode) { switch(statusCode) { case 502: case 503: