Repository navigation
fix(bootstrap): an infra image build holds this machine's lock for its tag - #731
Merged
earakely-scale merged 1 commit intoNov 17, 2026
Conversation
…s tag Two test workers, each with a state root of its own, set up the gateway env at once on main's v0.9.1550 bump and built env-gateway together; the second failed with "image ... already exists", main went red and the release didn't publish. The build now holds image-build:<tag>, as a host image's build does, which the integration tier's workers share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/infra-image-builds-take-the-machine-lock
branch
November 17, 2026 04:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
main's CI failed on the v0.9.1550 bump commit, so the release'smain-cicheck failed, no infra image was published and v0.9.1550 didn't reach PyPI. The failure was inintegration-local-slow (8/12):When the gateway isn't published for the sources under test, as on the bump after #725 changed it, every bundle run that sets up its own
defaultgateway buildsenv-gateway. Each test has a state root of its own, so the lockensure_default_envstakes is per test. Two workers on one runner then built the same tag with the same Docker at once, and the second failed.Builds of a host image already hold this machine's
image-build:lock (host_images.py), and the integration tier shares that prefix across its workers (MACHINE_LOCKSintst/integration/conftest.py). An infra image's build didn't take it.What changes
bootstrap._build_and_putholdsimage-build:<tag>around itsdocker build, so two builds of one infra image tag take turns: two test workers, or two runs with state roots of their own on one machine.Testing
image-build:<tag>. It fails onmain(no lock held) and passes here;tst/unit/env/bootstrap_test.py: 52 passed.integration-local-slowexercises the path whenever a PR changes the gateway.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Infra image builds now hold
image-build:<tag>while Docker builds the image.Diagram
sequenceDiagram participant A as Worker A participant L as Shared tag lock participant D as Docker participant B as Worker B A->>L: Acquire image-build tag lock A->>D: Build image B->>L: Wait for the same lock D-->>A: Build finishes A->>L: Release lock L-->>B: Acquire lock B->>D: Build imageReviews (1) · Last reviewed commit: "fix(bootstrap): an infra image build hol..." · Reviewed by Greptile