waitForIndexStatusYellow: Don't reject on 408 status from health api (#119136) (#119159)

Co-authored-by: Rudolf Meijering <rudolf.meijering@elastic.co>
This commit is contained in:
Kibana Machine 2021-11-19 10:22:44 -05:00 committed by GitHub
parent 43fb6d388a
commit 0a3cce7f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,11 +40,16 @@ export const waitForIndexStatusYellow =
}: WaitForIndexStatusYellowParams): TaskEither.TaskEither<RetryableEsClientError, {}> =>
() => {
return client.cluster
.health({
index,
wait_for_status: 'yellow',
timeout,
})
.health(
{
index,
wait_for_status: 'yellow',
timeout,
},
// Don't reject on status code 408 so that we can handle the timeout
// explicitly and provide more context in the error message
{ ignore: [408] }
)
.then((res) => {
if (res.body.timed_out === true) {
return Either.left({