Skip to content

Commit 78ab10a

Browse files
handle rate limiting retries for Elastic Inference Service
1 parent d65f34d commit 78ab10a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceServiceResponseHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ protected void checkForFailureStatusCode(Request request, HttpResult result) thr
4040
throw new RetryException(false, buildError(METHOD_NOT_ALLOWED, request, result));
4141
} else if (statusCode == 413) {
4242
throw new ContentTooLargeException(buildError(CONTENT_TOO_LARGE, request, result));
43+
} else if (statusCode == 429) {
44+
throw new RetryException(true, buildError(RATE_LIMIT, request, result));
4345
}
4446

4547
throw new RetryException(false, buildError(UNSUCCESSFUL, request, result));

0 commit comments

Comments
 (0)