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

LifecycleAware onStop does not get called when plugin is uninstalled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 6.7.0
    • Server - Platform
    • None

    Description

      When a component in plugin implements LifecycleAware interface, the onStart/onStop methods are supposed to be called when the plugin is started/stopped. However, the onStop is not triggered when the plugin is uninstalled. 

      The confluence implementation of LifecycleManager com.atlassian.sal.confluence.lifecycle.TenantAwareLifecycleManager does not seem to do it correctly. 

       Steps to replicate it: 

      1. Create a class implementing LifecycleAware in a plugin:

      public class TestComponent implements LifecycleAware {
      
          public ExpiredSessionRemover() {
             
          }
      
          @Override
          public void onStart() {
             System.out.println("TestComponent started");
          }
      
          @Override
          public void onStop() {
              System.out.println("TestComponent stopped")
          }
      
      

      2. Register it in plugin.xml

      <component key="testComponent" class="com.abc.TestComponent" public="true">
          <interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface>
      </component>
      

      3. Deploy the plugin

      4. Uninstall the plugin

      You will see the "TestComponent started" is printed in console while "TestComponent stopped" is not printed. 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            zzhou Zhenhuan Zhou (Inactive)
            Votes:
            14 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: