Details
-
Bug
-
Resolution: Fixed
-
Medium
-
8.9.1, 8.11.0, 8.10.1
-
8.09
-
17
-
Severity 2 - Major
-
91
-
Description
Issue Summary
The warning logs were added, because starting from Jira 9 it would not be possible to use RequestCache without the context - it's incorrect and slow. Context is necessary for proper creation and termination of the RequestCache. Without it, RequestCache does not behave like a cache - it will fetch data from database for every call.
It was straightforward task, but with unexpected results. It seems that in Jira DC incorrect usage of RequestCache is very common. So common, that it is flooding the log files of running instances & makes the testing very hard.
Steps to Reproduce
- Install Jira Software 8.10.0 or 8.11.0
The below exception is thrown in the atlassian-jira.log file:
2020-07-16 18:21:48,050-0300 PlatformInstrumentsLoggingService RUNNING WARN [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-16 18:21:48,050-0300 PlatformInstrumentsLoggingService RUNNING WARN [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-16 18:21:48,050-0300 PlatformInstrumentsLoggingService RUNNING WARN [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-16 18:21:48,109-0300 JMXInstrumentsLoggingService RUNNING WARN [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-16 18:21:48,109-0300 JMXInstrumentsLoggingService RUNNING WARN [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-16 18:21:48,110-0300 JMXInstrumentsLoggingService RUNNING WARN [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details.
Workaround
Setting the log level of the com.atlassian.jira.cache.request.RequestCacheImpl package to ERROR per the documentation Logging and profiling
This configuration will filter out relevant warnings as well.
Temporary way to set the package to ERROR (this setting will go away after a Jira restart)
- In Jira, go to ⚙ > System > Logging and profiling page
- Scroll down to Default Loggers > Configure logging level for another package, and add com.atlassian.jira.cache.request.RequestCacheImpl package with the ERROR level
Permanent way to set the package to ERROR (this setting will remain after a Jira restart)
- Edit the file <JIRA_INSTALLATION>/atlassian-jira/WEB-INF/classes/log4j.properties
- Add the 2 following lines at the end of the file and save it:
log4j.logger.com.atlassian.jira.cache.request.RequestCacheImpl = ERROR, filelog log4j.additivity.com.atlassian.jira.cache.request.RequestCacheImpl = false
- Restart the Jira application
Attachments
Issue Links
- is duplicated by
-
JRASERVER-71316 RequestCache being used in an invalid context
-
- Closed
-
-
JSWSERVER-20643 JMXInstrumentsLoggingService RUNNING WARN - RequestCache being used in an invalid context
-
- Closed
-
- relates to
-
JSDSERVER-6897 RequestCache being used in an invalid context
-
- Closed
-
-
GRD-2586 Loading...
-
POSTSEFCON-10366 Loading...
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...