Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-25969

JiraPluginSettingsFactory.createSettingsForKey(projectKey) should not load eagerly and the result should be cached for the rest of the request

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      The bit of code:

          public PluginSettings createSettingsForKey(final String key)
          {
              Supplier<? extends PropertySet> propertySet = null;
              if (key != null)
              {
                  propertySet = Suppliers.memoize(LazyProjectMigratingPropertySet.create(projectManager, jiraPropertySetFactory,
                                  jiraPropertySetFactory.buildCachingDefaultPropertySet(key, true), key));
              }
              else
              {
                  ...
              }
              return new JiraPluginSettings(propertySet);
          }
      

      When the project key is passed in the parameter, this will always call jiraPropertySetFactory.buildCachingDefaultPropertySet(key, true) first, which will build the NON-caching property set and eagerly load it.

      Since this is project key related, the client code is unlikely to keep a reference to it other than using it as a local variable, it would be great if the result is cached in the request thread locals, as many plugins may have to call this when serving the same request.

      Attached is an inCallOrder recorded for one request that has the plugin settings for project 'BMW' loaded for dozen of times.

              Unassigned Unassigned
              awei Alex Wei (DE)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: