mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
fix(es-setup): retry docker pull on "i/o timeout" (#189988)
This commit is contained in:
parent
1cb191fb69
commit
d54fc70160
1 changed files with 12 additions and 2 deletions
|
@ -382,6 +382,12 @@ export async function maybeCreateDockerNetwork(log: ToolingLog) {
|
|||
log.indent(-4);
|
||||
}
|
||||
|
||||
const RETRYABLE_DOCKER_PULL_ERROR_MESSAGES = [
|
||||
'connection refused',
|
||||
'i/o timeout',
|
||||
'Client.Timeout',
|
||||
];
|
||||
|
||||
/**
|
||||
*
|
||||
* Pull a Docker image if needed. Ensures latest image.
|
||||
|
@ -407,8 +413,12 @@ ${message}`;
|
|||
{
|
||||
retries: 2,
|
||||
onFailedAttempt: (error) => {
|
||||
// Only retry if `connection refused` is found in the error message.
|
||||
if (!error?.message?.includes('connection refused')) {
|
||||
// Only retry if retryable error messages are found in the error message.
|
||||
if (
|
||||
RETRYABLE_DOCKER_PULL_ERROR_MESSAGES.every(
|
||||
(msg) => !error?.message?.includes('connection refused')
|
||||
)
|
||||
) {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue