RestChunkedXContentListener always responds with a 200 Status.OK #98389
Labels
>bug
:Core/Infra/REST API
REST infrastructure and utilities
priority:high
A label for assessing bug priority to be used by ES engineers
:Search Foundations/Search
Catch all for Search Foundations
Team:Core/Infra
Meta label for core/infra team
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
v8.9.0
Elasticsearch Version
8.9
Installed Plugins
No response
Java Version
bundled
OS Version
n/a
Problem Description
#94736 reworked search responses to use chunked responses, reducing the probability that a very large response might cause out-of-memory problems on co-ordinating nodes. However, the REST layer code that handles these chunked responses always returns a status code of 200, and searches can return other codes here if some or all shards are missing. We should add a status-handling version of this code, similar to RestStatusToXContentListener.
I uncovered this while working on converting AsyncSearchResponse to use chunked responses, which tripped an explicit test that checks for the status code returned over the REST layer. It seems we don't have similar tests for plain searches.
Steps to Reproduce
n/a
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: