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

resource leakage and misleading log message when a bundled plugin gets upgraded

    XMLWordPrintable

Details

    Description

      This was discovered by having JIM-RC1 in bundled-plugins.zip and then installing JIM-final (via UPM or whatever). When you restart JIRA you get a message that looks like

      Ignoring the Spring context that was just created for plugin X. The plugin is in an invalid state, DISABLED, that doesn't support a transition to enabled.  Most likely, it was disabled due to a timeout.
      

      The problem here is that we have a bundled-plugin that is marked a RequiresRestart. During OsgiPlugin.disableInternal we have

                  // Only disable underlying bundle if this is a truly dynamic plugin
                  if (!PluginUtils.doesPluginRequireRestart(this))
                  {
                      if (getPluginState() == PluginState.ENABLING)
                      {
                          logAndClearOustandingDependencies();
                      }
                      helper.onDisable();
                      pluginEventManager.unregister(this);
                      getBundle().stop();
                      treatSpringBeanFactoryCreationAsRefresh = false;
                  }
      

      So this code isn't going to run. What we need to do is do most of this but not all. For instance, we want to leave the bundle running. So maybe something like:

                  else
                  {
                      if (getPluginState() == PluginState.ENABLING)
                      {
                          logAndClearOustandingDependencies();
                      }
                      helper.onDisable();
                      pluginEventManager.unregister(this);
                      //getBundle().stop();
                      treatSpringBeanFactoryCreationAsRefresh = false;
                  }
      

      However, we'll require manual testing in JIRA for things like workflow plugins to make sure that doesn't result in lots of exceptions all over the place.

      Attachments

        Activity

          People

            pleschev Peter Leschev
            jpendleton Justus Pendleton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: