Skip to content
Snippets Groups Projects
Select Git revision
0 results

jgit

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Shawn Pearce authored
    There is a potential race condition during insertPack that can lead
    to us having the same pack file open twice in the same directory.
    
    A different thread can miss an object on disk, and trigger a scan
    of the directory, and notice the pack that was put in by IndexPack.
    So the pack winds up in the newly created PackList.
    
    The IndexPack thread then wakes up and finishes its insertPack by
    creating a new PackFile and inserting it into position 0 of the list.
    We now have the same pack listed twice.
    
    Readers will favor the earlier PackFile instance, because its the
    first one they come across as they iterate through the list.
    
    Keep that earlier one when we scan the pack directory again, as
    this will avoid needing to purge out all of the windows that may
    have been cached.
    
    Of course we should also fix that race condition, but this block
    was taking the wrong resolution if this error ever shows up, so
    lets first fix the block to use a more sane resolution.
    
    Change-Id: I0d339b9fd1dd8012e8fe5a564b893c0f69109e28
    Signed-off-by: default avatarShawn O. Pearce <spearce@spearce.org>
    a0a52897
    History
    Name Last commit Last update