Uploaded image for project: 'Jira Server and Data Center'
  1. Jira Server and Data Center
  2. JRASERVER-73838

Invalid use of RequestCache by thread: JMXInstrumentsLoggingService (AbstractPerformanceDataLoggingService)

    XMLWordPrintable

Details

    Description

      Issue Summary

      AbstractPerformanceDataLoggingService 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

      Exact steps are unknown. Start Jira and after some time this error might be logged.

      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:

      Invalid use of RequestCache by thread: JMXInstrumentsLoggingService.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.config.feature.DefaultFeatureManager.isFlagEnabledByExternalActivator(DefaultFeatureManager.java:317)
          at com.atlassian.jira.config.feature.DefaultFeatureManager.isEnabled(DefaultFeatureManager.java:109)
      ...
          at com.atlassian.jira.diagnostics.perflog.AbstractPerformanceDataLoggingService.loggingFeatureIsEnabled(AbstractPerformanceDataLoggingService.java:88)
          at com.atlassian.jira.diagnostics.perflog.AbstractPerformanceDataLoggingService.runOneIteration(AbstractPerformanceDataLoggingService.java:74)
      ...

      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.

      Attachments

        Issue Links

          Activity

            People

              keroglu Kurtcebe Eroglu
              kcichy Kamil Cichy
              Votes:
              12 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: