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

"Cache merge" job fails to overwrite existing cache in the same scope #17

Open
develop7 opened this issue Nov 30, 2023 · 1 comment
Open

Comments

@develop7
Copy link

Hi.

I've been adopting the cache-nix-action back there at us in PostgREST, and it's working really great — cuts Nix & stuff deployment times by 50-70%; unless the relevant cache doesn't get evicted first. So, I've decided to adopt cache merging as well. The job itself is at https://github.com/PostgREST/postgrest/pull/3071/files#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd, heavily sprinkled with comments (because the technique isn't exactly straightforward). It looks like it should work, but there's this warning at the end of the cache save job log, right after the "okay, compressing and saving the cache" line:

Unable to reserve cache with key cache-nix-Linux-common-4949da85e72a9fd6af5a40b4ebaa1b14efe92d5e08807060bcb4414b681ac378, another job may be creating this cache. More details: Cache already exists. Scope: refs/pull/3077/merge, Key: cache-nix-Linux-common-4949da85e72a9fd6af5a40b4ebaa1b14efe92d5e08807060bcb4414b681ac378, Version: 4a1056d7529b065dc12b48db2d96984e8a91066b17ff25b040385973ff1a7e1e

Here's the link: https://github.com/PostgREST/postgrest/actions/runs/7035767110/job/19147207413#step:12:15

Do you maybe have any insights/suggestions on this? I'm kind of out of ideas, TBH

@deemp
Copy link
Collaborator

deemp commented Dec 4, 2023

Hi, @develop7! Sorry, I was busy recently. I don't see anything wrong with your workflow file for now. I think this behavior is because you run on PR. So, it doesn't have a permission to overwrite existing caches.

Additionally, thank you for comments in your workflow file. I think I should adopt them in the example workflow.

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

No branches or pull requests

2 participants