• Icon: Suggestion Suggestion
    • Resolution: Fixed
    • 5.7, 5.6-OD-38-053
    • None
    • 2
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

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

      (Unnecessary) parallel initialisation of I18NBeans causes heavy contention leading to significant delays in the HTTP responses.

      The symptom is that most HTTP workers will be waiting for a lock on a java.util.jar.JarFile instance.

      "http-127.0.0.1-8091-46" daemon prio=3 tid=0x0000000008b15000 nid=0x6bb waiting for monitor entry [0xfffffd7bc7e83000]
         java.lang.Thread.State: BLOCKED (on object monitor)
      	at java.util.zip.ZipFile.getEntry(ZipFile.java:302)
      	- waiting to lock <0xfffffd7bfd0efdf8> (a java.util.jar.JarFile)
      	at java.util.jar.JarFile.getEntry(JarFile.java:226)
      	at java.util.jar.JarFile.getJarEntry(JarFile.java:209)
      ...
      	at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1341)
      	at com.atlassian.plugin.impl.DefaultDynamicPlugin.getResourceAsStream(DefaultDynamicPlugin.java:53)
      	at com.atlassian.plugin.impl.AbstractDelegatingPlugin.getResourceAsStream(AbstractDelegatingPlugin.java:190)
      	at com.atlassian.confluence.util.i18n.PluginI18NResource.getPropertyResourceAsStream(PluginI18NResource.java:24)
      	at com.atlassian.confluence.util.i18n.AbstractI18NResource.getBundle(AbstractI18NResource.java:26)
      	at com.atlassian.confluence.util.i18n.AbstractI18NResource.getBundle(AbstractI18NResource.java:18)
      	at com.atlassian.confluence.util.i18n.I18NResourceBundlesLoader.getResourceBundles(I18NResourceBundlesLoader.java:55)
      	at com.atlassian.confluence.util.i18n.DefaultI18NBean.loadPluginI18NResources(DefaultI18NBean.java:149)
      	at com.atlassian.confluence.util.i18n.DefaultI18NBean.<init>(DefaultI18NBean.java:76)
      	at com.atlassian.confluence.util.i18n.DefaultI18NBeanFactory.getI18NBean(DefaultI18NBeanFactory.java:70)
      	at com.atlassian.confluence.util.i18n.CachingI18NBeanFactory.getI18NBean(CachingI18NBeanFactory.java:31)
      

      Given that it is CachingI18NBeanFactory's responsibility to cache a calculated I18NBean for a specific locale, the contention on individual JAR files is counter-productive, as in it hinders one specific thread of finishing the collection of all the i18n resources from the plugins. The suggested improvement is to only let one thread per locale produce the I18NBean and let the others wait until this is available. Thus you'd still have contention on the java.util.jar.JarFile instance level, e.g. one thread requesting the i18n resources from a plugin for English and another one requesting the i18n resources for the same plugin for German, but on a much smaller scale.

        1. 2013-04-10_eac_tds.tar.gz
          524 kB
        2. Selection_041.png
          Selection_041.png
          173 kB

            [CONFSERVER-30110] Improve CachingI18NBeanFactory implementation

            Thank you nbhawnani for sharing the release date!

            Mai Nakagawa (Inactive) added a comment - Thank you nbhawnani for sharing the release date!

            Niraj Bhawnani added a comment - - edited

            Hi mnakagawa, 5.7 is due to be released in late January 2015. The fix has already been released to Atlassian Cloud.

            Cheers,
            Niraj.

            Niraj Bhawnani added a comment - - edited Hi mnakagawa , 5.7 is due to be released in late January 2015. The fix has already been released to Atlassian Cloud. Cheers, Niraj.

            Hello,
            Would you share when the fixed version will be available, once the release date is confirmed? One of our customers suffers from this symptom and wants to know the release date.

            Mai Nakagawa (Inactive) added a comment - Hello, Would you share when the fixed version will be available, once the release date is confirmed? One of our customers suffers from this symptom and wants to know the release date.

            Write to your friendly Atlassian contact and let them know this is not an Improvement ticket but rather a bug.

            Sergey Svishchev added a comment - Write to your friendly Atlassian contact and let them know this is not an Improvement ticket but rather a bug.

            Why is this ticket not seeing more action? How can Confluence be Enterprise ready if you cannot install a plugin without making the server unresponsive for 5 minutes or more?

            Martin Sander added a comment - Why is this ticket not seeing more action? How can Confluence be Enterprise ready if you cannot install a plugin without making the server unresponsive for 5 minutes or more?

            This is exacerbated by the fact that the reload is triggered by any GlobalSettingsChangedEvent:

                public void handleEvent(Event event)
                {
                    clearCache();
                }
            ...
                public Class[] getHandledEventClasses()
                {
                    return new Class[] {GlobalSettingsChangedEvent.class, PluginEvent.class, PluginFrameworkStartedEvent.class};
                }
            

            Which is triggered in a lot of cases (where only a few could have impact on I18N):

            • General Configuration /admin/viewgeneralconfig.action
            • Languages /admin/configurelanguage.action
            • Manage Referrers /admin/managereferrers.action
            • Custom HTML /admin/viewcustomhtml.action
            • Security Configuration /admin/viewsecurityconfig.action
            • Backup Administration /admin/dailybackupadmin.action

            Maybe you guys should follow your own Javadoc (GlobalSettingsChangedEvent):

            /**
             * Event announcing a change in the global configuration of Confluence.
             * <p>Notes for implementors:
             * <ul>
             *     <li>This event may be published even when no change has been made to the settings. Always check the 'before'
             *         and 'after' snapshots to make sure that the setting you're monitoring has in fact changed.
            

            Martin Sander added a comment - This is exacerbated by the fact that the reload is triggered by any GlobalSettingsChangedEvent : public void handleEvent(Event event) { clearCache(); } ... public Class [] getHandledEventClasses() { return new Class [] {GlobalSettingsChangedEvent.class, PluginEvent.class, PluginFrameworkStartedEvent.class}; } Which is triggered in a lot of cases (where only a few could have impact on I18N): General Configuration /admin/viewgeneralconfig.action Languages /admin/configurelanguage.action Manage Referrers /admin/managereferrers.action Custom HTML /admin/viewcustomhtml.action Security Configuration /admin/viewsecurityconfig.action Backup Administration /admin/dailybackupadmin.action Maybe you guys should follow your own Javadoc (GlobalSettingsChangedEvent): /** * Event announcing a change in the global configuration of Confluence. * <p>Notes for implementors: * <ul> * <li>This event may be published even when no change has been made to the settings. Always check the 'before' * and 'after' snapshots to make sure that the setting you're monitoring has in fact changed.

              onevalainen Olli Nevalainen
              fakraemer fabs (Inactive)
              Votes:
              16 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated:
                Resolved: