]> source.dussan.org Git - jgit.git/commit
Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock 22/147522/5
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 11 Aug 2019 00:43:02 +0000 (02:43 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 16 Aug 2019 14:51:45 +0000 (16:51 +0200)
commit7f92a70fb3a5b7e91e5d370098fa65f6c8f35efa
tree7f1c63551671bd8f3d178baea4e9c2618cd68c00
parentfed2a8a4f9b905b6d11f90bf25f023d4ca736365
Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock

FS determines FileStore attributes in a background thread and tries to
save the results to the global git configuration. This competed with
LocalDiskRepositoryTestCase#setup trying to save changes to the same
file requiring the same lock. This frequently led to one of the threads
failing to acquire the lock.

Fix this by first initiating determination of FileStore attributes which
then uses a MockSystemReader not using a userConfig stored to disk which
avoids this race for the lock.

Change-Id: I30fcd96bc15100f8ef9b2a9eb3320bb5ace97c67
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java