Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-5370

A spurious FileLockException is thrown when a repository throws an exception on startup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 3.7.1, 3.8.0
    • 3.6.0
    • None
    • None

    Description

      If the process of starting a repository at startup of FishEye throws an exception, then that repository's InfinityDB instance is left open, even though the repository is not in the STATE_RUNNING state.

      This means that when the user tries to start the repository from the admin UI a spurious locking exception is thrown.

      e.g. initial exception:

      2014-10-15 07:18:03,907 WARN  [RepoStarter-5 storesvn ] fisheye DefaultRepositoryManager$3$1-call - Problem starting repository storesvn
      java.lang.NullPointerException
      	at com.atlassian.fisheye.svn.Svn2RepositoryEngine.getEarliestInState(Svn2RepositoryEngine.java:175)
      	at com.atlassian.fisheye.svn.Svn2RepositoryEngine.initialiseRepositoryStatus(Svn2RepositoryEngine.java:127)
      	at com.cenqua.fisheye.rep.RepositoryEngine.start(RepositoryEngine.java:218)
      	at com.cenqua.fisheye.rep.RepositoryHandle.run(RepositoryHandle.java:404)
      	at com.cenqua.fisheye.config.DefaultRepositoryManager.runRepository(DefaultRepositoryManager.java:352)
      	at com.cenqua.fisheye.config.DefaultRepositoryManager$3$1.call(DefaultRepositoryManager.java:403)
      	at com.cenqua.fisheye.config.DefaultRepositoryManager$3$1.call(DefaultRepositoryManager.java:399)
      	at com.cenqua.fisheye.util.NamedExecution.call(NamedExecution.java:31)
      	at com.cenqua.fisheye.config.DefaultRepositoryManager$3.call(DefaultRepositoryManager.java:399)
      	at com.cenqua.fisheye.config.DefaultRepositoryManager$3.call(DefaultRepositoryManager.java:395)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:724)
      

      will result in this Exception when the user tries to start the repo:

      Caused by: java.lang.RuntimeException: com.cenqua.fisheye.rep.DbException: com.cenqua.obfuscate.idbn5uu6o.locking.FileLockException: Cannot lock file in exclusive mode - already open internally
      	at com.cenqua.fisheye.infinitydb.CachingUniqueStringTable.initialCacheSize(CachingUniqueStringTable.java:137)
      	at com.cenqua.fisheye.infinitydb.CachingUniqueStringTable.<init>(CachingUniqueStringTable.java:28)
      	at com.cenqua.fisheye.infinitydb.CachingUSTDelegatorFactory.delegate(CachingUSTDelegatorFactory.java:6)
      	at com.cenqua.fisheye.infinitydb.InfinityDbHandle.createUniqueStringTable(InfinityDbHandle.java:171)
      	at com.cenqua.fisheye.rep.impl.CommonStringTables.createForId(CommonStringTables.java:44)
      	at com.cenqua.fisheye.rep.impl.CommonStringTables.<init>(CommonStringTables.java:29)
      	at com.cenqua.fisheye.svn.db.SvnStringTables.<init>(SvnStringTables.java:16)
      	at com.atlassian.fisheye.svn.Svn2Cache.<init>(Svn2Cache.java:83)
      	at com.atlassian.fisheye.svn.Svn2RepositoryEngine.createCache(Svn2RepositoryEngine.java:70)
      	at com.atlassian.fisheye.svn.Svn2RepositoryEngine.createCache(Svn2RepositoryEngine.java:26)
      	at com.cenqua.fisheye.rep.BaseRepositoryEngine.doStart(BaseRepositoryEngine.java:57)
      	at com.cenqua.fisheye.rep.RepositoryEngine.start(RepositoryEngine.java:200)
      	at com.cenqua.fisheye.rep.RepositoryHandle.run(RepositoryHandle.java:404)
      	at com.cenqua.fisheye.config.DefaultRepositoryManager.runRepository(DefaultRepositoryManager.java:352)
      	at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.start(DefaultRepositoryAdminService.java:1329)
      

      We should be reporting exceptions thrown during startup as engine errors in the UI.

      Workaround

      Completely re-index the repository:

      1. Stop the repository.
      2. Backup and delete the index folder at FISHEYE_INST/var/cache/<reponame>
      3. Start the repository.

      Attachments

        Issue Links

          Activity

            People

              glewandowski Grzegorz Lewandowski
              tom@atlassian.com Tom Davies
              Votes:
              5 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: