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

gvfs-helper: better support for concurrent packfile fetches #229

Merged

Commits on Dec 20, 2019

  1. gvfs-helper: better support for concurrent packfile fetches

    Teach gvfs-helper to better support the concurrent fetching of the
    same packfile by multiple instances.
    
    If 2 instances of gvfs-helper did a POST and requested the same set of
    OIDs, they might receive the exact same packfile (same checksum SHA).
    Both processes would then race to install their copy of the .pack and
    .idx files into the ODB/pack directory.
    
    This is not a problem on Unix (because of filesystem semantics).
    
    On Windows, this can cause an EBUSY/EPERM problem for the loser while
    the winner is holding a handle to the target files.  (The existing
    packfile code already handled simple the existence and/or replacement
    case.)
    
    The solution presented here is to silently let the loser claim
    victory IIF the .pack and .idx are already present in the ODB.
    (We can't check this in advance because we don't know the packfile
    SHA checksum until after we receive it and run index-pack.)
    
    We avoid using a per-packfile lockfile (or a single lockfile for
    the `vfs-` prefix) to avoid the usual issues with stale lockfiles.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler committed Dec 20, 2019
    Configuration menu
    Copy the full SHA
    b22f1ec View commit details
    Browse the repository at this point in the history