Skip to content

feat: flock 并发控制(fetch 与 clone 互斥) #11

Description

@lishuceo

背景

PR #9 引入了 bare clone 缓存层,多个 session 可能并发访问同一缓存仓库。当前 ensureBareCache 存在 TOCTOU 竞态:两个并发请求可能同时 clone 同一仓库(浪费带宽),git fetchgit clone 也可能同时操作同一 bare cache。

需求

  • 使用文件锁(flockproper-lockfile)互斥同一缓存目录的 fetch 和 clone 操作
  • 多个 fetch 并发时串行化

参考

设计文档 docs/workspace-cache-and-restart.md 2.3 节

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions