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

Confluence Hangs and Throw Errors During Shutdown but doesn't stop

      Summary

      When shutting down Confluence using the service or via shutdown.sh or shutdown.bat, it can throw errors. When this happens, Confluence will appear to hang and the shutdown process is extremely slow

      Steps to Reproduce

      1. Install Confluence
      2. Start Confluence
      3. Let Confluence run for a bit
      4. Shutdown Confluence

      Expected Results

      Confluence shutsdown without issue

      Actual Results

      Confluence can hang on shutdown and throw errors in the logs, for example the below exception is thrown in the atlassian-confluence.log file:

      2015-10-21 12:23:13,174 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.plugin.notifications.notifications-module, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs
      2015-10-21 12:23:13,174 ERROR [localhost-startStop-2] [support.internal.aop.ServiceDynamicInterceptor] serviceChanged Exception during service event handling
      java.lang.IllegalStateException: Invalid BundleContext.
      	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514)
      	at org.apache.felix.framework.BundleContextImpl.getServiceReferences(BundleContextImpl.java:425)
      	at org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReferences(OsgiServiceReferenceUtils.java:159)
      	at org.springframework.osgi.util.OsgiServiceReferenceUtils.getServiceReference(OsgiServiceReferenceUtils.java:76)
      	at org.springframework.osgi.service.importer.support.internal.aop.ServiceDynamicInterceptor$Listener.serviceChanged(ServiceDynamicInterceptor.java:195)
      	at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
      	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
      	at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
      	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4419)
      	at org.apache.felix.framework.Felix.access$000(Felix.java:74)
      	at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:401)
      	at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:151)
      	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:127)
      	at org.apache.felix.framework.ServiceRegistry.unregisterServices(ServiceRegistry.java:196)
      	at org.apache.felix.framework.Felix.stopBundle(Felix.java:2555)
      	at org.apache.felix.framework.Felix.uninstallBundle(Felix.java:2632)
      	at org.apache.felix.framework.BundleImpl.uninstall(BundleImpl.java:1022)
      	at com.atlassian.plugin.osgi.factory.OsgiPlugin.uninstallInternal(OsgiPlugin.java:503)
      	at com.atlassian.plugin.impl.AbstractPlugin.uninstall(AbstractPlugin.java:425)
      	at com.atlassian.plugin.impl.AbstractDelegatingPlugin.uninstall(AbstractDelegatingPlugin.java:196)
      	at com.atlassian.plugin.loaders.ScanningPluginLoader.onShutdown(ScanningPluginLoader.java:245)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48)
      	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107)
      	at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
      	at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)
      	at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73)
      	at com.atlassian.plugin.event.impl.DefaultPluginEventManager.broadcast(DefaultPluginEventManager.java:73)
      	at com.atlassian.plugin.manager.DefaultPluginManager.broadcast(DefaultPluginManager.java:608)
      	at com.atlassian.plugin.manager.DefaultPluginManager.shutdown(DefaultPluginManager.java:598)
      	at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextDestroyed(PluginFrameworkContextListener.java:77)
      	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
      	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
      	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
      	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      

      Workaround

      • Start/shutdown Confluence using start-confluence.sh and stop-confluence.sh (or .bat if you are on Windows)

            [CONFSERVER-39662] Confluence Hangs and Throw Errors During Shutdown but doesn't stop

            SK1975 added a comment -

            Same on JIRA 8.2.3 clean install!

             

            Windows Server 2012 R2 Standard

            SK1975 added a comment - Same on JIRA 8.2.3 clean install!   Windows Server 2012 R2 Standard

            SK1975 added a comment -

            Same errors when shutting down service or shutdown.bat ...
            Jira Software 8.2.0

            SK1975 added a comment - Same errors when shutting down service or shutdown.bat ... Jira Software 8.2.0

            Tony DeLuca added a comment - - edited

            It would be nice if this bug was addressed and fixed. I am on version 6.13.3 ER. Thanks!

             

            Tony

            Tony DeLuca added a comment - - edited It would be nice if this bug was addressed and fixed. I am on version 6.13.3 ER. Thanks!   Tony

            We also face the same error in Confluence-5.8.18. It's throwing error and takes time to shutdown

            2016-09-28 15:18:35,560 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsg
            iBundleXmlApplicationContext(bundle=com.atlassian.plugin.notifications.notifications-module, config=osgibundle:/META-INF/spring/*.xml) did not finish in 1000
            0ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs
            2016-09-28 15:18:35,567 ERROR [localhost-startStop-2] [support.internal.aop.ServiceDynamicInterceptor] serviceChanged Exception during service event handling
            java.lang.IllegalStateException: Invalid BundleContext.
            

            Transversal It - it tools added a comment - We also face the same error in Confluence-5.8.18. It's throwing error and takes time to shutdown 2016-09-28 15:18:35,560 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsg iBundleXmlApplicationContext(bundle=com.atlassian.plugin.notifications.notifications-module, config=osgibundle:/META-INF/spring/*.xml) did not finish in 1000 0ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs 2016-09-28 15:18:35,567 ERROR [localhost-startStop-2] [support.internal.aop.ServiceDynamicInterceptor] serviceChanged Exception during service event handling java.lang.IllegalStateException: Invalid BundleContext.

            5.10.4

            2016-09-12 17:52:21,843 INFO [localhost-startStop-2] [atlassian.plugin.manager.DefaultPluginManager] shutdown Preparing to shut down the plugin system
            2016-09-12 17:52:21,905 INFO [localhost-startStop-2] [atlassian.plugin.manager.DefaultPluginManager] shutdown Shutting down the plugin system
            2016-09-12 17:52:38,014 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.adaptavist.confluence.form-mail-ng, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs
            

            Pavel Potcheptsov added a comment - 5.10.4 2016-09-12 17:52:21,843 INFO [localhost-startStop-2] [atlassian.plugin.manager.DefaultPluginManager] shutdown Preparing to shut down the plugin system 2016-09-12 17:52:21,905 INFO [localhost-startStop-2] [atlassian.plugin.manager.DefaultPluginManager] shutdown Shutting down the plugin system 2016-09-12 17:52:38,014 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.adaptavist.confluence.form-mail-ng, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs

            April added a comment -

            Also appears in 5.9.5, and appears related to Hipchat:
            2016-03-15 17:38:28,197 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.plugins.base-hipchat-integration-plugin-api, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs

            2016-03-15 17:38:38,203 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.labs.hipchat.confluence-hipchat, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs

            April added a comment - Also appears in 5.9.5, and appears related to Hipchat: 2016-03-15 17:38:28,197 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle= com.atlassian.plugins.base-hipchat-integration-plugin-api , config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs 2016-03-15 17:38:38,203 ERROR [localhost-startStop-2] [internal.util.concurrent.RunnableTimedExecution] execute Closing runnable for context NonValidatingOsgiBundleXmlApplicationContext(bundle= com.atlassian.labs.hipchat.confluence-hipchat , config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs

            We are also experiencing this behaviour with Confluence 5.8.15

            foryouandyourcustomers added a comment - We are also experiencing this behaviour with Confluence 5.8.15

            I am experiencing this. The service will eventually stop but can take a few minutes.

            Ross Bender added a comment - I am experiencing this. The service will eventually stop but can take a few minutes.

              Unassigned Unassigned
              sbrannen@atlassian.com Branno (Inactive)
              Affected customers:
              25 This affects my team
              Watchers:
              24 Start watching this issue

                Created:
                Updated: