Skip to content

Commit

Permalink
[data.search] Fix format of CCS timed out responses (elastic#181919)
Browse files Browse the repository at this point in the history
## Summary

@jughosta noticed in
elastic#179679 (comment)
that when modifying the response format after we hit a time out, we
weren't properly setting the `timed_out` flag to `true` on the entire
response object, just on the individual clusters. This PR fixes that
behavior.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
  • Loading branch information
lukasolson authored and yuliacech committed May 3, 2024
1 parent 833194f commit cd75084
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('toPartialResponseAfterTimeout', () => {
id: 'FmZBc2NuYlhsU1JxSk5LZXNRczVxdEEed3l6LUVycTVTVGl1LWtDSVdta2VkQToxODUzODUx',
rawResponse: {
took: 4414,
timed_out: false,
timed_out: true,
terminated_early: false,
num_reduce_phases: 2,
_shards: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function toPartialResponseAfterTimeout(response: IEsSearchResponse): IEsS
isRunning: false,
rawResponse: {
...rawResponse,
timed_out: true,
_clusters: {
...clusters,
details,
Expand Down

0 comments on commit cd75084

Please sign in to comment.