Repository navigation
post: skip sticky disk cleanup when this step reused an existing buildkitd - #136
Merged
Merged
Conversation
…dkitd When setup-docker-builder runs more than once in a job, only the first instance starts buildkitd and mounts /var/lib/buildkit. Later instances 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. Record reuse in action state and have the post step exit early in that case. 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
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. Since dc5a171, later instances detect the running daemon and reuse it, and their post step correctly skips shutdown viamaybeShutdownBuildkitd()— but it then falls straight into thesync/ integrity check /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 this happens on every reuse instance before the owning instance's post finally shuts down and unmounts successfully. Net effect: the disk was being cleaned up, but each reuse instance emitted a spurious cleanup failure (N-1 false reports per job with N setup invocations, which only happens when earlier attempts failed).Fix: record reuse in action state and have the post step exit early in that case.
A dedicated state key is used rather than
!getBuildkitdAddr()because the fallback path (sticky disk mounted, buildkitd failed to start) also has no addr but does still need the unmount.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.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled. (Staging)