Add buildctl du diagnostics around prune#75
Add buildctl du diagnostics around prune#75ConnorMul wants to merge 2 commits intouseblacksmith:mainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| let beforeStats = ""; | ||
| try { | ||
| const { stdout } = await execAsync(`cat ${statPath}`); | ||
| beforeStats = stdout.trim(); |
There was a problem hiding this comment.
Integrity checks lost hard timeout protection
High Severity
checkBoltDbIntegrity now uses bare execAsync for filesystem and bbolt commands, so stalled I/O can block forever. The previous execWithTimeout/ExecTimeoutError path that allowed skipping on hangs was removed, which can freeze post-action cleanup.
Additional Locations (1)
| const { stdout: duBeforeSummary } = await execAsync( | ||
| `sudo buildctl --addr ${BUILDKIT_DAEMON_ADDR} du 2>&1 | tail -5`, | ||
| ); | ||
| core.info(`Cache summary before prune: ${duBeforeSummary}`); |
There was a problem hiding this comment.
New buildctl du diagnostics can hang cleanup
Medium Severity
The new pre/post-prune buildctl du diagnostics run without timeout limits. If buildkitd is unresponsive, these calls can block indefinitely and prevent prune, shutdown, unmount, and sticky-disk commit from completing.
Additional Locations (1)
| const { stdout: dbFiles } = await execAsync( | ||
| "find /var/lib/buildkit -name '*.db' 2>/dev/null || true", | ||
| 30_000, | ||
| "find db files", |
There was a problem hiding this comment.
Documented max-parallelism input no longer applied
Medium Severity
The public max-parallelism input is still declared in action.yml, but parsing and override logic were removed. User-provided values are now silently ignored and parallelism is always derived from CPU count.


Summary
buildctl du --verboseoutput logging before and after thepruneBuildkitCache()call in the post-action cleanupBUILDKIT_DAEMON_ADDRfromsetup_builder.tsso it can be used inmain.tsbuildctl prune --keep-duration 168h --allis removing freshly built layers due to nilLastUsedAton cache-miss-created entriesContext
A customer (hoverinc/ug-engine) reported Docker layer cache misses despite only changing a single comment. Investigation suggests the
--allflag in the prune command may treat newly created layers (with nilLastUsedAt) as "never used" and prune them immediately.Test plan
docker-layer-cache-reproworkflow in test-workflows with this branch🤖 Generated with Claude Code