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

Invalid use of RequestCache by thread: insight-InsightThreadGroup-worker-thread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 8.20.6
    • None

    Description

      Issue Summary

      insight-InsightThreadGroup-worker-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

      This is reproducible on Data Center: (no)

      1. Rebuild Asset Cache and index

      Expected Results

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

      Actual Results

      Error reported and Asset cache inconsistent

      The below exception is thrown in the atlassian-jira.log file:

      2023-08-01 16:28:12,213+0200 insight-InsightThreadGroup-worker-thread-0 ERROR X221296 987x517x1 eiyzqv 10.210.112.228,10.208.5.56 /rest/insight/1.0/index/reindex/start [c.a.j.cache.request.RequestCacheRecorderImpl] Invalid use of RequestCache by thread: insight-InsightThreadGroup-worker-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:93)
      	at com.atlassian.jira.config.feature.DefaultFeatureManager.getDarkFeatures(DefaultFeatureManager.java:176)
      	at com.atlassian.jira.config.feature.DefaultFeatureManager.isEnabled(DefaultFeatureManager.java:103)
      	at com.atlassian.jira.config.feature.DefaultFeatureManager.isEnabled(DefaultFeatureManager.java:116)
      	at com.atlassian.jira.config.feature.DefaultFeatureManager.isEnabled(DefaultFeatureManager.java:127)
      	at jdk.internal.reflect.GeneratedMethodAccessor544.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy228.isEnabled(Unknown Source)
      	at jdk.internal.reflect.GeneratedMethodAccessor544.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
      	at com.sun.proxy.$Proxy4904.isEnabled(Unknown Source)
      	at io.riada.insight.index.model.ObjectTicketConnectionIndexImpl.convertToInsightObjectTicketConnection(ObjectTicketConnectionIndexImpl.java:351)
      	at io.riada.insight.index.model.ObjectTicketConnectionIndexImpl.putObjectTicketConnection(ObjectTicketConnectionIndexImpl.java:91)
      	at com.riadalabs.jira.plugins.insight.services.core.index.ReindexServiceImpl.reindexObjectTickets(ReindexServiceImpl.java:423)
      	at com.riadalabs.jira.plugins.insight.services.core.index.ReindexServiceImpl.reloadAllCaches(ReindexServiceImpl.java:350)
      	at com.riadalabs.jira.plugins.insight.services.core.impl.ClusterAwareReindexServiceImpl.access$500(ClusterAwareReindexServiceImpl.java:50)
      	at com.riadalabs.jira.plugins.insight.services.core.impl.ClusterAwareReindexServiceImpl$ClusterAwareReindexJob.executeTask(ClusterAwareReindexServiceImpl.java:197)
      	at com.riadalabs.jira.plugins.insight.services.core.impl.ClusterAwareReindexServiceImpl$ClusterAwareReindexJob.executeTask(ClusterAwareReindexServiceImpl.java:175)
      	at com.riadalabs.jira.plugins.insight.services.core.multithreadservice.InsightServiceJob.call(InsightServiceJob.java:41)
      	at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	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

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              4bbe53f6c66f Louis (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Backbone Issue Sync