Repository navigation
post: skip sticky disk cleanup when this step reused an existing buildkitd (release/v2) - #137
Merged
bruce-y merged 1 commit intoSep 8, 2026
Conversation
…dkitd (release/v2) When setup-docker-builder runs more than once in a job, only the first instance starts buildkitd and mounts /var/lib/buildkit. Later instances (builderMode=existing) already skipped shutdown but still ran the unmount path while buildkitd was alive, failing with 'target is busy' and reporting BUILDER_CLEANUP for a disk they do not own. Exit the post step early in that case; the teardown telemetry report is still shipped. Co-Authored-By: bruce <[email protected]>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
piob-io
approved these changes
Sep 4, 2026
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.
Summary
release/v2 port of #136.
When
setup-docker-builderruns more than once in the same job (e.g. a composite action that retries a build and calls setup + build-push per attempt), only the first instance startsbuildkitdand mounts/var/lib/buildkit. Later instances detect the running daemon and reuse it (builderMode=existing), and their post step correctly skips shutdown viamaybeShutdownBuildkitd()— but it then falls straight into thesync/umount /var/lib/buildkitblock whilebuildkitdis still alive. That unmount fails 3× withtarget is busyand is reported asBUILDER_CLEANUP, feedingblacksmith_stickydisk_failures_totaland the "Docker Setup High Failure Count" alert. Post steps run in reverse order, so every reuse instance emits a spurious failure before the owning instance's post finally shuts down and unmounts successfully.Fix: in the post step, if
stateHelper.getBuilderMode() === "existing", skip the whole cleanup + commit-gating block. Unlike v1, v2 already records this mode in state, so no new state key is needed. The structured teardown report is still shipped for that instance (withcommitSkipReason=NO_EXPOSE, as today) so theEXISTINGbuilder mode remains visible in telemetry.removeTmpDir()andshipTeardownReport()are extracted from the inline post-step code so the early-return path can reuse them.dist/regenerated via the pre-commit hook.Link to Devin session: https://app.devin.ai/sessions/b01cb52c7bbb4211ab8557e8e880086d
Open in Devin Desktop: https://app.devin.ai/desktop/session/b01cb52c7bbb4211ab8557e8e880086d?variant=devin
Requested by: @bruce-y
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled. (Staging)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.