mirror of
https://github.com/docker/setup-buildx-action.git
synced 2026-05-13 13:58:12 +00:00
Compare commits
1 Commits
8526d56de4
...
7cd46c6dac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cd46c6dac |
18
src/main.ts
18
src/main.ts
@ -48,6 +48,15 @@ async function retryWithBackoff<T>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if an error is a buildkit socket connection error
|
||||||
|
*/
|
||||||
|
function isBuildkitSocketError(error: Error): boolean {
|
||||||
|
return error.message.includes('/run/buildkit/buildkitd.sock') ||
|
||||||
|
error.message.includes('failed to list workers') ||
|
||||||
|
error.message.includes('connection error');
|
||||||
|
}
|
||||||
|
|
||||||
actionsToolkit.run(
|
actionsToolkit.run(
|
||||||
// main
|
// main
|
||||||
async () => {
|
async () => {
|
||||||
@ -221,9 +230,14 @@ actionsToolkit.run(
|
|||||||
// If the command takes too long, we'll get the timeout error instead
|
// If the command takes too long, we'll get the timeout error instead
|
||||||
return Promise.race([execPromise, timeoutPromise]);
|
return Promise.race([execPromise, timeoutPromise]);
|
||||||
},
|
},
|
||||||
3, // maxRetries - retry up to 3 times for buildkit initialization
|
5, // maxRetries - retry up to 5 times for buildkit initialization
|
||||||
1000, // initialDelay - start with 1 second
|
1000, // initialDelay - start with 1 second
|
||||||
15000 // maxDelay - cap at 15 seconds
|
15000, // maxDelay - cap at 15 seconds
|
||||||
|
(error) => {
|
||||||
|
// Retry on buildkit socket errors or timeouts
|
||||||
|
return isBuildkitSocketError(error) ||
|
||||||
|
error.message.includes('Timeout exceeded while waiting for buildkit');
|
||||||
|
}
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Log the warning but continue - this matches current behavior where builds still succeed
|
// Log the warning but continue - this matches current behavior where builds still succeed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user