Degrade gracefully when sticky disk mount fails#60
Merged
Conversation
When the mount fails (e.g. a Connect/gRPC error talking to the host agent), create the requested path as an empty runner-owned directory so downstream steps see a cache miss instead of a missing path. In the post step, skip unmount and commit when the disk was never mounted so an empty fallback directory can't clobber existing cached data. Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
dist/ was rebuilt by CI (run 27388547061) with BUF_TOKEN access since the private @buf packages cannot be installed outside CI. Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com>
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.
When the action fails to obtain or mount the sticky disk (e.g. a Connect/gRPC error like
ConnectError: [canceled] This operation was aborted), it warned and continued without ever creating the user-specifiedpath. Downstream steps referencing files under it then failed with "No such file or directory" (real example:tar -xf /mnt/deps/deps.tzstfailing because/mnt/depsdidn't exist). This PR makes a failed mount look like a fresh, empty sticky disk (a cache miss) instead of a missing path.How it works:
Error getting sticky diskwarning,ensureFallbackDirectorycreates the path with the samesudo mkdir -p+ non-recursivechownto the runner user that a successful mount performs (including the nested-workspace parent chown), so an existing directory and its contents are left untouched. The step still succeeds, preserving the non-blocking behavior.STICKYDISK_ERRORaction state; the post step now reads it up front. When the path isn't mounted and the mount had failed, it logs an info notice and returns before any unmount or commit, socommit: truecan't push the empty fallback directory back and clobber the customer's existing cached snapshot.STICKYDISK_ERROR.Validated with eslint, prettier, and tsc.
dist/is rebuilt and committed (built in CI withBUF_TOKENaccess since the private@buf/blacksmith_vm-agent.*packages cannot be installed locally); the Build Action check passes.Need help on this PR? Tag
/codesmithwith what you need. Autofix is enabled. (Staging)Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.