Skip to content

Commit 56c99f9

Browse files
Use status code 429 for circuit breakers
1 parent 9bb620e commit 56c99f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/common/breaker/CircuitBreakingException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public long getByteLimit() {
6969

7070
@Override
7171
public RestStatus status() {
72-
return RestStatus.SERVICE_UNAVAILABLE;
72+
return RestStatus.TOO_MANY_REQUESTS;
7373
}
7474

7575
@Override

server/src/test/java/org/elasticsearch/rest/RestControllerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public void testDispatchRequestLimitsBytes() {
279279
int contentLength = BREAKER_LIMIT.bytesAsInt() + 1;
280280
String content = randomAlphaOfLength((int) Math.round(contentLength / inFlightRequestsBreaker.getOverhead()));
281281
RestRequest request = testRestRequest("/", content, XContentType.JSON);
282-
AssertingChannel channel = new AssertingChannel(request, true, RestStatus.SERVICE_UNAVAILABLE);
282+
AssertingChannel channel = new AssertingChannel(request, true, RestStatus.TOO_MANY_REQUESTS);
283283

284284
restController.dispatchRequest(request, channel, new ThreadContext(Settings.EMPTY));
285285

0 commit comments

Comments
 (0)