Details
-
Bug
-
Resolution: Done
-
Major
-
6.3.1.GA, 6.4.0
-
Windows 2012 / Windows 7
community 0.9.x branch whereUF-401fix is already committed
-
Release Notes
-
CR1
-
-
Description
When JGitUtil.commit() and JGitUtil.checkPath() are called from multiple threads concurrently in Windows, sometimes JGitUtil.checkPath() returns a "NOT_FOUND" Pair for an existing path even after the fix of UF-401.
By adding some debug logging, I confirmed that
git.getRepository().resolve( branchName + "^{tree}" )
returns null so checkPath() returns a "NOT_FOUND" Pair without throwing an Exception (so not captured by UF-401 retry logic).
Attached a reproducer (multi-thread-jgit-test-01.zip), which contains 5 test methods:
testCommitAndResolvePath : test for commit() + resolvePath()
testCommitAndResolveInputStream : test for commit() + resolveInputStream()
testCommitAndListPathContent : test for commit() + listPathContent()
testCommitAndCheckPath : test for commit() + checkPath()
testCommitAndGetLastCommit : test for commit() + getLastCommit()
Note that the reproducer runs for uberfire 0.9.0-SNAPSHOT.
In Linux, all tests pass.
In Windows, testCommitAndListPathContent, testCommitAndCheckPath and testCommitAndGetLastCommit fail with the same reason. testCommitAndResolvePath and testCommitAndResolveInputStream pass because resolvePath() and resolveInputStream() don't have null check so it throws NullPointerException which is eventually captured by UF-401 retry logic.
Interestingly, 1.0.0-SNAPSHOT doesn't reproduce this issue. I'm not sure but probably because of jgit version (3.7.1 vs 4.4.1).