5 Replies Latest reply on Feb 16, 2010 1:11 AM by Maciej Jaźwiński

    TimeoutException during JBoss shutdown

    Maciej Jaźwiński Newbie

      Hi,

       

         When closing jboss using interrupt signal (shutdown hook is enabled properly) with cache enabled TimeoutException is throw for every category defined. I tried to install jboss shutdown hook, configure integration withoud cache manager (I know that it won't work according to docs, but wanted to try everything), modify LockAcquisitionTimeout and wakeUpIntervalSeconds - nothing helps. Errors occur only during shudown. Please help, I don't have any idea what is wrong.

       

      Environment:

      • JBoss 5.1 GA
      • Hibernate 3.3.2 GA
      • hibernate-jbosscache2-3.3.2.GA integration build from Hibernate branch (includes fix for HHH-3818)
      • Java 6 b17

       

      Cache config:

      • Local mode
      • Cache manager with custom config

       

          <cache-config name="cust-optimistic">

       

              <!-- Node locking scheme -->
              <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>

       

              <!-- Mode of communication with peer caches.
             
                   INVALIDATION_SYNC is highly recommended as the mode for use
                   with entity and collection caches.
              -->
              <attribute name="CacheMode">LOCAL</attribute>

       

              <!-- Max number of milliseconds to wait for a lock acquisition -->
              <attribute name="LockAcquisitionTimeout">15000</attribute>

       

            <!--  Eviction policy configurations. -->
            <attribute name="EvictionPolicyConfig">
              <config>
                <attribute name="wakeUpIntervalSeconds">30</attribute>
                <!-- Name of the DEFAULT eviction policy class. -->
                <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
                <!--  Cache wide default -->
                <region name="/_default_">
                  <!-- Evict LRU node once we have more than this number of nodes -->
                  <attribute name="maxNodes">10000</attribute>
                  <!-- And, evict any node that hasn't been accessed in this many seconds -->
                  <attribute name="timeToLiveSeconds">600</attribute>
                </region>
               
                  <region name="/_cust/sys/FormControlEntity">
                      <attribute name="maxNodes">3000</attribute>
                      <!-- 20 min -->
                      <attribute name="maxAge">120000</attribute>
                  </region>
                <!--  Don't ever evict modification timestamps -->
                <region name="/TS" policyClass="org.jboss.cache.eviction.NullEvictionPolicy"/>
              </config>
           </attribute>

       

          </cache-config>

       

       

      Below is a thread dump of one of the exceptions. JBoss Shutdown Hook is the lock owner.

       

      2010-02-02 18:08:45,530 WARN  [org.jboss.cache.interceptors.OptimisticTxInterceptor] (JBoss Shutdown Hook) Rolling back, exception encountered
      org.jboss.cache.lock.TimeoutException: failure acquiring lock: fqn=/TS/_cust/org/hibernate/cache/UpdateTimestampsCache, caller=GlobalTransaction:<null>:33, lock=write owner=Thread[JBoss Shutdown Hook,5,jboss] (activeReaders=0, activeWriter=Thread[JBoss Shutdown Hook,5,jboss], waitingReaders=0, waitingWriters=0, waitingUpgrader=0)
          at org.jboss.cache.lock.IdentityLock.acquire(IdentityLock.java:534)
          at org.jboss.cache.lock.NodeBasedLockManager.acquireLock(NodeBasedLockManager.java:87)
          at org.jboss.cache.lock.NodeBasedLockManager.lock(NodeBasedLockManager.java:117)
          at org.jboss.cache.interceptors.OptimisticInterceptor.lockAndCreateWorkspaceNode(OptimisticInterceptor.java:134)
          at org.jboss.cache.interceptors.OptimisticNodeInterceptor.fetchWorkspaceNode(OptimisticNodeInterceptor.java:583)
          at org.jboss.cache.interceptors.OptimisticNodeInterceptor.visitRemoveNodeCommand(OptimisticNodeInterceptor.java:103)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.EvictionInterceptor.visitRemoveNodeCommand(EvictionInterceptor.java:223)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
          at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
          at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
          at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
          at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)
          at org.jboss.cache.interceptors.OptimisticTxInterceptor.handleDefault(OptimisticTxInterceptor.java:83)
          at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)
          at org.jboss.cache.commands.AbstractVisitor.visitRemoveNodeCommand(AbstractVisitor.java:75)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
          at org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)
          at org.jboss.cache.interceptors.InvocationContextInterceptor.visitRemoveNodeCommand(InvocationContextInterceptor.java:88)
          at org.jboss.cache.commands.write.RemoveNodeCommand.acceptVisitor(RemoveNodeCommand.java:125)
          at org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)
          at org.jboss.cache.invocation.CacheInvocationDelegate.removeNode(CacheInvocationDelegate.java:478)
          at org.hibernate.cache.jbc2.BasicRegionAdapter.destroy(BasicRegionAdapter.java:327)
          at org.hibernate.cache.jbc2.timestamp.TimestampsRegionImpl.destroy(TimestampsRegionImpl.java:148)
          at org.hibernate.cache.UpdateTimestampsCache.destroy(UpdateTimestampsCache.java:118)
          at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:833)
          at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
          at org.jboss.jpa.deployment.ManagedEntityManagerFactory.destroy(ManagedEntityManagerFactory.java:93)
          at org.jboss.jpa.deployment.PersistenceUnitDeployment.stop(PersistenceUnitDeployment.java:333)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
          at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
          at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
          at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
          at org.jboss.kernel.plugins.dependency.LifecycleAction.uninstallActionInternal(LifecycleAction.java:249)
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:157)
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:42)
          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleUninstallAction(SimpleControllerContextAction.java:79)
          at org.jboss.dependency.plugins.action.AccessControllerContextAction.uninstall(AccessControllerContextAction.java:131)
          at org.jboss.dependency.plugins.AbstractControllerContextActions.uninstall(AbstractControllerContextActions.java:58)
          at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
          at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
          at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
          at org.jboss.system.ServiceController.stop(ServiceController.java:510)
          at org.jboss.system.microcontainer.jmx.ServiceControllerStartStopLifecycleCallback.uninstall(ServiceControllerStartStopLifecycleCallback.java:52)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
          at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
          at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
          at org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300)
          at org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:286)
          at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.uninstall(AbstractLifecycleCallbackItem.java:112)
          at org.jboss.dependency.plugins.AbstractController.handleLifecycleCallbacks(AbstractController.java:1570)
          at org.jboss.dependency.plugins.AbstractController.handleUninstallLifecycleCallbacks(AbstractController.java:1546)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1273)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
          at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:655)
          at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:568)
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:153)
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:51)
          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalUndeploy(AbstractSimpleRealDeployer.java:69)
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.undeploy(AbstractRealDeployer.java:112)
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.undeploy(DeployerWrapper.java:196)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doUndeploy(DeployersImpl.java:1469)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1376)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1369)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.uninstall(DeployersImpl.java:1331)
          at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
          at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:694)
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
          at org.jboss.system.server.profileservice.repository.ProfileDeployAction.uninstall(ProfileDeployAction.java:95)
          at org.jboss.system.server.profileservice.repository.AbstractProfileAction.uninstall(AbstractProfileAction.java:70)
          at org.jboss.system.server.profileservice.repository.AbstractProfileService.uninstall(AbstractProfileService.java:375)
          at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
          at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
          at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1234)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
          at org.jboss.system.server.profileservice.repository.AbstractProfileService.deactivateProfile(AbstractProfileService.java:402)
          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.deactivateProfiles(ProfileServiceBootstrap.java:388)
          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.shutdown(ProfileServiceBootstrap.java:345)
          at org.jboss.bootstrap.AbstractServerImpl.shutdownServer(AbstractServerImpl.java:571)
          at org.jboss.bootstrap.AbstractServerImpl$ShutdownHook.run(AbstractServerImpl.java:909)