Skip to content

Conversation

@deitch
Copy link
Collaborator

@deitch deitch commented Jun 26, 2025

- What I did
Made concurrent write access to the cache's index safe.

- How I did it

  1. Centralized all write access to the cache's index.json into a single file
  2. Added file locking utility using fcntl on Unix and Unix-like systems
  3. Leveraged the file locking for cache writes

Ignored read locks for now, although the utility supports it. Too many places it could be added.

- How to verify it
CI to ensure no regressions, manual testing for lock timing.

- Description for the changelog

Concurrent access to writing index.json in cache

@deitch
Copy link
Collaborator Author

deitch commented Jun 26, 2025

Fixes #4131

@deitch deitch force-pushed the centralize-safe-cache-writes branch from c1408db to 9e4d499 Compare June 26, 2025 15:18
@deitch deitch merged commit 4df360d into linuxkit:master Jun 26, 2025
22 checks passed
@deitch deitch deleted the centralize-safe-cache-writes branch June 26, 2025 16:02
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