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

JIRA may cache wrong value config scheme due to race condition

XMLWordPrintable

      Issue Summary

      JIRA might through the following exception in GUI:

      Caused by: java.lang.NullPointerException: config
      	at java.util.Objects.requireNonNull(Objects.java:228)
      	at com.atlassian.jira.issue.fields.option.CachedOptionSetManager.getOptionsForConfig(CachedOptionSetManager.java:42)
      	at com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManagerImpl.getIssueTypesForConfigScheme(IssueTypeSchemeManagerImpl.java:272)
      	at com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManagerImpl.getIssueTypesForProject(IssueTypeSchemeManagerImpl.java:242)
      	at com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManagerImpl.getIssueTypesForProject(IssueTypeSchemeManagerImpl.java:247)
      	at com.atlassian.jira.rest.v2.issue.project.ProjectBeanFactoryImpl.fullProject(ProjectBeanFactoryImpl.java:112)
      	at com.atlassian.jira.rest.v2.issue.ProjectResource$1.apply(ProjectResource.java:226)
      	at com.atlassian.jira.rest.v2.issue.ProjectResource$1.apply(ProjectResource.java:223)
      	at com.atlassian.fugue.Either$LeftProjection.on(Either.java:698)
      	at com.atlassian.jira.rest.v2.issue.ProjectResource.getProject(ProjectResource.java:223)
       ... 265 more
      

      Environment

      DC, 2 nodes

      Steps to Reproduce

      Node A - node with debug port opened
      Node B - node w/o need of debug port

      1. Start cluster
      2. On Node A attach a breakpoint in com.atlassian.jira.issue.fields.config.persistence.FieldConfigSchemePersisterImpl#update, before line storeConfigAssociations
        • Make sure breakpoint will suspend thread, not whole JVM
      3. Still on Node A via browser, try to attach new issue type to issue type scheme via "Modify Issue Type Scheme" screen:
        1. Create new issue type
        2. Go to "Issue type schemes"
        3. Click "edit" on some scheme
        4. Move created issue type from "Available Issue Types" column to "Issue Types for Current Scheme"
        5. Click Save - breakpoint should be hit
      4. In Node B open Create issue Dialog making sure that active project uses scheme we are trying to modify
        • Note: Sometimes despite breakpoint caches are propagated between nodes. To force node B to load data from DB, we can invalidate caches before opening dialog
      5. Review actual behaviour - see Actual Results below:

      Expected Results

      No exceptions should be thrown

      Actual Results

      Dialog breaks, with stacktrace visible in the console:

      2018-02-24 08:47:55,471 http-nio-8090-exec-13 WARN admin 527x7069x2 1jnu1i9 0:0:0:0:0:0:0:1 /secure/QuickCreateIssue!default.jspa [c.a.j.i.fields.config.FieldConfigSchemeImpl] There is not exactly one config for this scheme (10200). Configs are {}.
      2018-02-24 08:47:55,476 http-nio-8090-exec-13 ERROR [o.a.c.c.C.[.[localhost].[/jira].[action]] Servlet.service() for servlet [action] in context with path [/jira] threw exception [java.lang.NullPointerException: config] with root cause
      java.lang.NullPointerException: config
      	at java.util.Objects.requireNonNull(Objects.java:228)
      	at com.atlassian.jira.issue.fields.option.CachedOptionSetManager.getOptionsForConfig(CachedOptionSetManager.java:42)
      	at com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManagerImpl.getIssueTypesForConfigScheme(IssueTypeSchemeManagerImpl.java:272)
      	at com.atlassian.jira.issue.fields.config.manager.IssueTypeSchemeManagerImpl.getSubTaskIssueTypesForProject(IssueTypeSchemeManagerImpl.java:265)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy33.getSubTaskIssueTypesForProject(Unknown Source)
      	... 3 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
      	at com.sun.proxy.$Proxy33.getSubTaskIssueTypesForProject(Unknown Source)
      	at com.atlassian.jira.quickedit.action.QuickCreateIssue.setSelectedIssueTypeId(QuickCreateIssue.java:510)
      	at com.atlassian.jira.quickedit.action.QuickCreateIssue.doDefault(QuickCreateIssue.java:195)
      	... 3 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
      	at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
      

      Workaround

      No workaround exist yet

              Unassigned Unassigned
              soslopov Sergey
              Votes:
              24 Vote for this issue
              Watchers:
              33 Start watching this issue

                Created:
                Updated: