Skip to content

File locking for concurrent cache access #3

@slauger

Description

@slauger

When two openvox-code sync processes run in parallel (e.g. multiple CI jobs), they can corrupt each other's bare clone caches.

Problem:

  • EnsureClone checks for HEAD, then clones — race between check and clone
  • fetch --prune during another process's git archive can cause failures
  • No locking mechanism on the cache directory

Proposed solution:

  • Use flock(2) / fcntl file locks on a .lock file per bare clone
  • Read lock for archive, rev-parse, for-each-ref
  • Write lock for clone, fetch
  • Consider golang.org/x/sys/unix for portable file locking

Impact: Data corruption in CI environments with parallel pipelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions