From 2393fce3aa096dcb3f4352438d05f3ebc12efa6f Mon Sep 17 00:00:00 2001 From: Rudolf Meijering Date: Fri, 19 Nov 2021 14:41:04 +0100 Subject: [PATCH] waitForIndexStatusYellow: Don't reject on 408 status from health api (#119136) --- .../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({