Skip to content

Commit ee9fdc9

Browse files
authored
Change rest status for TooManyBucketsException (#95304) (#95328)
Resolves #37957 Retrying will not resolve TooManyBucketsException, therefore we should not return a 5xx class error. After some discussion, we decided 400 - Bad Request was the most appropriate choice.
1 parent e0ce8c2 commit ee9fdc9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/changelog/95304.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 95304
2+
summary: Change rest status for `TooManyBucketsException`
3+
area: Aggregations
4+
type: bug
5+
issues:
6+
- 37957

server/src/main/java/org/elasticsearch/search/aggregations/MultiBucketConsumerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public int getMaxBuckets() {
7575

7676
@Override
7777
public RestStatus status() {
78-
return RestStatus.SERVICE_UNAVAILABLE;
78+
return RestStatus.BAD_REQUEST;
7979
}
8080

8181
@Override

0 commit comments

Comments
 (0)