Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-22341

Upgrade of user plugin causes it to be re-installed on every subsequent other plugin install

    XMLWordPrintable

Details

    Description

      If you upgrade a user plugin, every subsequent plugin installation will cause the upgraded plugin to re-install. I'm seeing this with Speakeasy as when I upgrade Speakeasy, any future extension installation causes Speakeasy to be reinstalled.

      To replicate, install Speakeasy twice, then use the new extension wizard to create a new extension. The screen will hang and you'll see all sorts of exceptions in the logs, due to Speakeasy being reinstalled during the request. The exceptions indicate that code running after the speakeasy upgrade fails due to classes not being able to be loaded as the bundle was uninstalled.

      The problem seems to be in DatabasePluginScanner. The 'units' variable stores the deployment unit to plugin id, and 'loadedPluginData' stores the plugin id to modified date. When an Speakeasy is upgraded, the old plugin is removed, including being removed from both these variables. While there may be temporarily two deployment units, the old and new, there is only one id. After the plugin system determined this is an upgrade, it asks the PluginLoader to remove the old plugin, but in doing so, it looks up the plugin id from the deployment unit and removes both the plugin id and deployment unit from from loadedPluginData and units, respectively. The former is the problem area. Next time a plugin is installed, the scanner will get the Speakeasy plugin id from its deployment and try to look up its last modified time from loadedPluginData. It won't find any, causing it to be re-installed.

      Attachments

        Activity

          People

            dbrown@atlassian.com Don Brown (Inactive)
            dbrown@atlassian.com Don Brown (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: