Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-63188

As an JIRA Administrator I want to have debug logging for DefaultIndexManager lock (writeLock)

XMLWordPrintable

    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Problem Definition

      Currently when JIRA needs to work with Lucene index (Full locked reindex, apply index snapshot, apply index from another node in JDC), it need to get the indexLock.writeLock in the withReindexLock method.

      If system is busy or some of componets forget to release the lock, you will get and exception:

      2016-10-18 15:38:51,732 ClusterMessageHandlerServiceThread:thread-1 ERROR      [jira.issue.index.DefaultIndexManager] Wait attempt timed out - waited 60000 milliseconds
      com.atlassian.jira.issue.index.IndexException: Wait attempt timed out - waited 60000 milliseconds
      	at com.atlassian.jira.issue.index.DefaultIndexManager.obtain(DefaultIndexManager.java:936)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.access$900(DefaultIndexManager.java:97)
      	at com.atlassian.jira.issue.index.DefaultIndexManager$IndexLock.tryLock(DefaultIndexManager.java:1298)
      	at com.atlassian.jira.issue.index.DefaultIndexManager.withReindexLock(DefaultIndexManager.java:375)
      ...
      	at com.atlassian.jira.index.ha.DefaultIndexRecoveryManager.recoverIndexFromBackup(DefaultIndexRecoveryManager.java:124)
      	at com.atlassian.jira.index.ha.DefaultIndexCopyService$MessageConsumer.restoreIndex(DefaultIndexCopyService.java:175)
      	at com.atlassian.jira.index.ha.DefaultIndexCopyService$MessageConsumer.receive(DefaultIndexCopyService.java:195)
      	at com.atlassian.jira.cluster.OfBizMessageHandlerService.sendLocalFromNode(OfBizMessageHandlerService.java:260)
      	at com.atlassian.jira.cluster.OfBizMessageHandlerService.handleReceivedMessages(OfBizMessageHandlerService.java:153)
      	at com.atlassian.jira.cluster.OfBizMessageHandlerService.access$000(OfBizMessageHandlerService.java:34)
      	at com.atlassian.jira.cluster.OfBizMessageHandlerService$1.run(OfBizMessageHandlerService.java:59)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      2016-10-18 15:38:52,495 ClusterMessageHandlerServiceThread:thread-1 ERROR      [atlassian.jira.cluster.OfBizMessageHandlerService] There was a problem handling a cluster message
      java.lang.RuntimeException: com.atlassian.jira.issue.index.IndexException: Failed to acquire reindex lock
      	at com.atlassian.jira.index.ha.DefaultIndexCopyService$MessageConsumer.restoreIndex(DefaultIndexCopyService.java:179)
      	at com.atlassian.jira.index.ha.DefaultIndexCopyService$MessageConsumer.receive(DefaultIndexCopyService.java:195)
      ...
      Caused by: com.atlassian.jira.issue.index.IndexException: Failed to acquire reindex lock
      	at com.atlassian.jira.index.ha.DefaultIndexRecoveryManager.recoverIndexFromBackup(DefaultIndexRecoveryManager.java:126)
      	at com.atlassian.jira.index.ha.DefaultIndexCopyService$MessageConsumer.restoreIndex(DefaultIndexCopyService.java:175)
      	... 12 more
      

      There is no debug informantion to understand why DefaultIndexManager was not able to get the lock and who holds the lock

      Suggested Solution

      Log debuging information when DefaultIndexManager failed to accure the lock.

      Workaround

      None

              mrzymski Maciej Rzymski
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: