Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors from concurrent builds with cache: enable #24

Merged
merged 2 commits into from May 20, 2022

Conversation

t0yv0
Copy link
Contributor

@t0yv0 t0yv0 commented May 19, 2022

When test-driving cache: enable at scale, pulumi/pulumi#9628 - it seems to work and result in cache hits, but sometimes there is a race with an exception on a cache miss:

Error: Unable to reserve cache with key action-install-gh-release/pulumi/pulumictl/v0.0.31/linux-x64, another job may be creating this cache. More details: Cache already exists. Scope: refs/pull/9628/merge, Key: action-install-gh-release/pulumi/pulumictl/v0.0.31/linux-x64, Version: b7e495078f01e0ba3aac532b3e4b5eb2809dcb6b5752b5d432363c38c69bce7a

I'm borrowing some error-handling code here found in actions/cache repo https://github.com/actions/cache/blob/d55d005ab0cbd9310b447311bcd1661be90843f5/src/save.ts#L47

It should be OK to downgrade this to a warning; in the case of a race, the first-write-wins is fine. The key of the cache uniquely determines the binary version.

@jaxxstorm jaxxstorm merged commit d919e59 into jaxxstorm:master May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants