FIX: Add retry mechanism with exponential backoff for buildkit bootstrap step
This should fix: https://github.com/docker/setup-buildx-action/issues/283
There is a race condition in the buildx setup process:
- When the action runs docker buildx inspect --bootstrap --builder
, it's trying to initialize the buildkit daemon. - The error occurs because the action is trying to communicate with buildkit via its socket file (/run/buildkit/buildkitd.sock) before the daemon is fully initialized.
The fix here is to continue retrying until the daemon is fully initialized, and timing the bootstrap out after 15 seconds to attempt a retry, instead of waiting many minutes.
Try and replace docker/setup-buildx-action@v3 with: danielamar101-pton/setup-buildx-action@fix-buildx-bootstrap-race-condition to use my version, and notice a reduction in waiting for this action.
@crazy-max thoughts here? We used the fix here and noticed a considerable reduction in time waiting for this action, when it displays this intermittent race condition.
@crazy-max implemented the change to retry for any error instead of just buildx errors, as well as reduced the max retry attempts. Your final request warrants further discussion.