Skip to content

Commit

Permalink
Retry tasks that timeout with timeout_exception or receive_timeout_tr…
Browse files Browse the repository at this point in the history
…ansport_exception
  • Loading branch information
rudolf committed Mar 24, 2021
1 parent c218ce2 commit fd249da
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/server/saved_objects/migrationsv2/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,20 @@ const waitForTask = (
description: body.task.description,
});
})
.catch((e) => {
if (
e.body?.error?.type === 'timeout_exception' ||
e.body?.error?.type === 'receive_timeout_transport_exception'
) {
return Either.left({
type: 'retryable_es_client_error' as const,
message: `[${e.body.error.type}] ${e.body.error.reason}`,
error: e,
});
} else {
throw e;
}
})
.catch(catchRetryableEsClientErrors);
};

Expand Down

0 comments on commit fd249da

Please sign in to comment.