Skip to content

Use run_id in ccache key to prevent concurrent save conflicts#50

Merged
ltowarek merged 1 commit into
mainfrom
fix/ccache-run-id
May 16, 2026
Merged

Use run_id in ccache key to prevent concurrent save conflicts#50
ltowarek merged 1 commit into
mainfrom
fix/ccache-run-id

Conversation

@ltowarek
Copy link
Copy Markdown
Owner

Summary

  • The Dockerfile-hash key is identical for all concurrent PRs and matrix jobs that share the same Dockerfile
  • When two jobs race to save the same key, one fails with "Unable to reserve cache with key ..., another job may be creating this cache"
  • Using github.run_id makes the primary key unique per run, so saves never collide
  • restore-keys still warm up from the most recently saved cache for each matrix slot, then fall back to any slot

Test plan

  • Verify no "Unable to reserve cache" warnings appear when matrix jobs run in parallel
  • Verify cache is restored on a second run (Cache restored from key: ccache-Linux-idf-...)

🤖 Generated with Claude Code

A Dockerfile-hash key is identical across all concurrent PRs and matrix
jobs sharing the same Dockerfile, causing "Unable to reserve cache" races.
Using run_id makes the primary key unique per run so saves never collide.
restore-keys still warm up from the most recent cache for each matrix slot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ltowarek ltowarek merged commit a90708e into main May 16, 2026
5 checks passed
@ltowarek ltowarek deleted the fix/ccache-run-id branch May 16, 2026 22:24
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.

1 participant