Skip to content

Commit 9cb8990

Browse files
[Inference API] add rate-limited retries for Elastic Inference Service (elastic#127487)
1 parent 245f5ee commit 9cb8990

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)