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

Invalid use of RequestCache by thread: JIRA-Import-Thread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 11.1.0
    • 9.4.8
    • Data Center - Other
    • None

      Issue Summary

      /secure/admin/XmlRestore.jspa (JIRA-Import-Thread-) uses RequestCache outside of a context.

      See JRASERVER-72963#comment-3059444 for more details.

      Note There is a whole family of "Invalid use of RequestCache by thread..." issues, one per thread. Find the one you need or file a new one.

      Steps to Reproduce

      Attempt a new XML restore in a new Jira instance v 9.4.8

      Expected Results

      RequestCache is used inside a context and no error is logged.

      Actual Results

      RequestCache is used outside of a context, which risks an incorrect cache behaviour.

      The following error appears in atlassian-jira.log file:

      2023-01-01 00:00:00,000+0000 JIRA-Import-Thread-0 ERROR user sesionID IP /secure/admin/XmlRestore.jspa [c.a.j.cache.request.RequestCacheRecorderImpl] Invalid use of RequestCache by thread: JIRA-Import-Thread.Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. This message will be logged once per thread. This ERROR should be fixed on the caller side (check the stack-trace or thread-name) as it is causing inconsistent data.
      java.lang.Throwable
      	at com.atlassian.jira.cache.request.RequestCacheRecorderImpl.errorLogOOCThreadUsage(RequestCacheRecorderImpl.java:32)
      	at com.atlassian.jira.cache.request.RequestCacheRecorderImpl.recordRequestCacheOOCUsage(RequestCacheRecorderImpl.java:25)
      	at com.atlassian.jira.cache.request.RequestCacheImpl.get(RequestCacheImpl.java:47)
      	at com.atlassian.jira.transaction.RequestLocalTransactionRunnableQueueFactoryImpl.getRunnablesQueue(RequestLocalTransactionRunnableQueueFactoryImpl.java:21)
      	at com.atlassian.jira.transaction.TransactionSupportImpl.begin(TransactionSupportImpl.java:30)
      	at com.atlassian.jira.transaction.Txn.begin(Txn.java:17)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.createWithRetry(OfbizImportHandler.java:527)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.lambda$createValue$0(OfbizImportHandler.java:508)
      	at com.atlassian.jira.util.concurrent.BoundedExecutor$1.run(BoundedExecutor.java:50)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      ...

      Workaround

      No workaround is required. This message will be logged only once for this thread.

      It is advised not to turn off logging for RequestCacheRecorderImpl to avoid losing insight into this problem.

              klopacinski Karol Lopacinski
              szarazinski Sławomir Zaraziński
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: