3 Replies Latest reply on Dec 22, 2010 11:48 AM by Galder Zamarreño

    HAPartition deadlocked

    alex soto Newbie

      Hello,

       

      I am running JBoss 5.1.0.GA.  The web application and EJBS are in separate servers in the same cluster.  A deadlock occurred where the web application blocked when looking up the EJBs in JNDI. 

       

       

      A thread dump from the deadlocked web application server shows multiple threads with the same trace:

       

      - waiting on <0x59cfe529> (a java.util.concurrent.locks.ReentrantLock$NonfairSync
      sun.misc.Unsafe.park(Native Method)
      java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
      java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
      java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:842)
      java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1178)
      java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
      java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
      org.jboss.seam.Component.getInstanceFromFactory(Component.java:2082)
      

       

       

      They are all waiting on synchronization object 0x59cfe529. 

      The one thread that appears to be holding this lock shows:

       

      - waiting on <0x7091fea5> (a org.jboss.ha.framework.server.ClusterPartition$ThreadGate)
      java.lang.Object.wait(Native Method)
      org.jboss.ha.framework.server.ClusterPartition$ThreadGate.await(ClusterPartition.java:2336)
      org.jboss.ha.framework.server.ClusterPartition.callMethodOnCluster(ClusterPartition.java:1089)
      org.jboss.ha.framework.server.ClusterPartition.callMethodOnCluster(ClusterPartition.java:1074)
      org.jboss.ha.jndi.HAJNDI.lookupRemotely(HAJNDI.java:248)
      org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:206)
      sun.reflect.GeneratedMethodAccessor624.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:318)
      $Proxy424.lookup(Unknown Source)
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      javax.naming.InitialContext.lookup(InitialContext.java:392)
      org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1346)
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:817)
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:833)
      org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      javax.naming.InitialContext.lookup(InitialContext.java:392)
      
      ........
       
      
      
      Locked synchronizers : 
      - locked <0x59cfe529> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
      

       

       

      I thought about enabling deadlock detection on the HAPartition configuration, but I found that this is discouraged here: https://jira.jboss.org/browse/JBAS-5821

       

      This JIRA entry suggest:

      Use of properly sized thread pools does the same job

       

      So should I increase the thread pool?

      How do I go about avoiding this deadlock problem?

       

       

      Any hints will be greatly appreciated.

      TIA