digitalroastery / weblounge

Web Content Management System
12 stars 4 forks source link

Weblounge won't shut down when sites are waiting for registration #315

Closed ghost closed 10 years ago

ghost commented 10 years ago

While a site is started and waits for its HTTP servlet to come online, Weblounge won't react properly to shutdown requests.

ghost commented 10 years ago

The reason is that the registering thread is waiting in SiteDispatcherServiceImpl.addSite() and that Thread is not a Daemon thread when it comes from the OSGi activator.

ghost commented 10 years ago

Daemon Thread Thread-26 (out of synch) waiting for: SiteManager (id=69) SiteManager.removeSite(Site) line: 388 (out of synch) SiteManager$SiteTracker$2.run() line: 592 (out of synch) Thread.run() line: 695 [local variables unavailable]

Daemon Thread Thread-24 (out of synch) owns: SiteManager (id=69) owns: ArrayList (id=70) waiting for: HashMap<K,V> (id=68) Object.wait(long) line: not available [native method] SiteDispatcherServiceImpl.addSite(Site) line: 444 (out of synch) SiteDispatcherServiceImpl.siteAppeared(Site, ServiceReference) line: 611 (out of synch) SiteManager.addSite(Site, ServiceReference) line: 354 (out of synch) SiteManager$SiteTracker$1.run() line: 572 (out of synch) Thread.run() line: 695

Daemon Thread CM Configuration Updater (Update: pid=ch.entwine.weblounge.contentrepository.factory.ea7a5ad6-060a-46c0-b1c3-dbe6bcdebc75) (out of synch) waiting for: SiteManager (id=69) SiteManager.addContentRepository(String, ContentRepository) line: 445 (out of synch) SiteManager$ContentRepositoryTracker.addingService(ServiceReference) line: 650 (out of synch) ServiceTracker$Tracked.customizerAdding(ServiceReference, ServiceEvent) line: 932 ServiceTracker$Tracked.customizerAdding(Object, Object) line: 864 ServiceTracker$Tracked(AbstractTracked<S,T,R>).trackAdding(S, R) line: 256 ServiceTracker$Tracked(AbstractTracked<S,T,R>).track(S, R) line: 229 ServiceTracker$Tracked.serviceChanged(ServiceEvent) line: 894 EventDispatcher.invokeServiceListenerCallback(Bundle, EventListener, Filter, Object, EventObject, Dictionary) line: 932 EventDispatcher.fireEventImmediately(EventDispatcher, int, Map<BundleContext,List>, EventObject, Dictionary) line: 793 EventDispatcher.fireServiceEvent(ServiceEvent, Dictionary, Framework) line: 543 Felix.fireServiceEvent(ServiceEvent, Dictionary) line: 4419 Felix.registerService(BundleContextImpl, String[], Object, Dictionary) line: 3423 BundleContextImpl.registerService(String[], Object, Dictionary<String,?>) line: 346 BundleContextImpl.registerService(String, Object, Dictionary<String,?>) line: 320 ContentRepositoryServiceFactory.updated(String, Dictionary) line: 208 (out of synch) ManagedServiceFactoryTracker.provideConfiguration(ServiceReference, TargetedPID, TargetedPID, Dictionary<String,?>, long, ConfigurationMap<?>) line: 88 ConfigurationManager$UpdateConfiguration.run() line: 1723 UpdateThread.run() line: 103 Thread.run() line: 695 [local variables unavailable]

Daemon Thread FelixStartLevel (out of synch) waiting for: ArrayList (id=70) SiteManager.removeSiteListener(SiteServiceListener) line: 111 (out of synch) EndpointPublishingService.deactivate(ComponentContext) line: 190 (out of synch) NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 DeactivateMethod(BaseMethod).invokeMethod(Object, Object) line: 236 BaseMethod.access$500(BaseMethod, Object, Object) line: 37 BaseMethod$Resolved.invoke(BaseMethod, Object, Object) line: 613 DeactivateMethod(BaseMethod).invoke(Object, Object, MethodResult) line: 496 DeactivateMethod(ActivateMethod).invoke(Object, Object, MethodResult) line: 149 ImmediateComponentManager.disposeImplementationObject(Object, ComponentContext, int) line: 272 ImmediateComponentManager.deleteComponent(int) line: 152 AbstractComponentManager$Active(AbstractComponentManager$State).doDeactivate(AbstractComponentManager, int, boolean) line: 1305 AbstractComponentManager$Active(AbstractComponentManager$Satisfied).dispose(AbstractComponentManager, int) line: 1617 ImmediateComponentManager(AbstractComponentManager).disposeInternal(int) line: 574 ImmediateComponentManager(AbstractComponentManager).dispose(int) line: 404 ImmediateComponentHolder.disposeComponents(int) line: 371 BundleComponentActivator.dispose(int) line: 320 Activator.disposeComponents(Bundle) line: 316 Activator.bundleChanged(BundleEvent) line: 183 EventDispatcher.invokeBundleListenerCallback(Bundle, EventListener, EventObject) line: 868 EventDispatcher.fireEventImmediately(EventDispatcher, int, Map<BundleContext,List>, EventObject, Dictionary) line: 789 EventDispatcher.fireBundleEvent(BundleEvent, Framework) line: 514 Felix.fireBundleEvent(int, Bundle) line: 4403 Felix.stopBundle(BundleImpl, boolean) line: 2520 Felix.setActiveStartLevel(int, FrameworkListener[]) line: 1309 FrameworkStartLevelImpl.run() line: 304 Thread.run() line: 695

ghost commented 10 years ago

This has been fixed under ticket #319