Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-4360

JGitUtil.checkPath() returns a "NOT_FOUND" Pair for an existing path with concurrent accesses in Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.4.0
    • 6.3.1.GA, 6.4.0
    • Business Central
    • Windows 2012 / Windows 7
      community 0.9.x branch where UF-401 fix is already committed

    • Release Notes
    • CR1
    • Hide

      Download and unzip multi-thread-jgit-test-01.zip
      mvn test

      Show
      Download and unzip multi-thread-jgit-test-01.zip mvn test

    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).

      https://github.com/uberfire/uberfire/blob/0.9.x/uberfire-nio2-backport/uberfire-nio2-impls/uberfire-nio2-jgit/src/main/java/org/uberfire/java/nio/fs/jgit/util/JGitUtil.java#L1323-L1326

      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).

      Attachments

        Activity

          People

            abakos@redhat.com Alexandre Bakos
            rhn-support-tkobayas Toshiya Kobayashi
            Tomas David Tomas David
            Tomas David Tomas David
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: