LifecycleAware onStop does not get called when plugin is uninstalled

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • None
    • Affects Version/s: 6.7.0
    • Component/s: Server - Platform
    • None
    • Severity 3 - Minor
    • 0

      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. 

       

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

                Created:
                Updated: