From 0a3cce7f4ff876f93950b654ef82476767e5f59c Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 19 Nov 2021 10:22:44 -0500 Subject: [PATCH] waitForIndexStatusYellow: Don't reject on 408 status from health api (#119136) (#119159) Co-authored-by: Rudolf Meijering --- .../actions/wait_for_index_status_yellow.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts b/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts index 9d4df0ced8c0b..676471d99b7d2 100644 --- a/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts +++ b/src/core/server/saved_objects/migrations/actions/wait_for_index_status_yellow.ts @@ -40,11 +40,16 @@ export const waitForIndexStatusYellow = }: WaitForIndexStatusYellowParams): TaskEither.TaskEither => () => { 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({