2 Replies Latest reply on Mar 12, 2010 8:04 AM by brettcave

    "Unable to acquire lock on Fqn" exception with clustered Pojocache

    brettcave

      When using pojocache in a clustered environment, the attach method throws an exception.

       

      JBoss AS 5.1.0.GA, with pojocache 3.0 and jboss cache 3.1 (casabel).

       

      The attach method works fine in a non-clustered environment, but the moment a second JBoss node is added to the partition, with the pojocache service deployed, any attach calls throw the exception below:

       

      Caused by: org.jboss.cache.pojo.PojoCacheException: attach failed /rules/9ec2c1bb-e37f-4592-9348-953dc164ed04
              at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:111)
              at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:93)
              at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:88)
              at com.mycompany.system.session.PojoCacheManagerBean.writeToCache(PojoCacheManagerBean.java:39)
              ... 246 more
      Caused by: org.jboss.cache.lock.TimeoutException: Unable to acquire lock on Fqn [/rules] after [10000] milliseconds for requestor [GlobalTransaction:<192.168.75.12:46555>:3468]! Lock held by [GlobalTransaction:<192.168.75.12:46555>:3469]
              at org.jboss.cache.mvcc.MVCCNodeHelper.acquireLock(MVCCNodeHelper.java:157)
              at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:235)
              at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:184)
              at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:225)
              at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:184)

      com.mycompany.system.session.PojoCacheManagerBean.writeToCache:

      public void writeToCache(Object ob, String path) {
          ObjectName on = new ObjectName("jboss.cache:service=PojoCache");
         
      PojoCache cache = (PojoCacheJmxWrapperMBean)
      MBeanServerInvocationHandler.newProxyInstance(MBeanServerLocator.locateJBoss(),
      on, PojoCacheJmxWrapperMBean.class, false).getPojoCache;
          cache.attach(ob,path);
      }
      
        • 1. Re: "Unable to acquire lock on Fqn" exception with clustered Pojocache
          brettcave
          
          <server>
             <mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper" name="jboss.cache:service=PojoCache">
                <depends>jboss:service=TransactionManager</depends>
                <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.JBossTransactionManagerLookup</attribute>
                <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
                <attribute name="CacheMode">REPL_SYNC</attribute>
                <attribute name="ClusterName">PojoCache-${jboss.partition.name:DefaultPartition}</attribute>
                <attribute name="ClusterConfig">
                   <config>
                      <UDP mcast_addr="228.1.2.3" mcast_port="48866"
                           ip_ttl="64" ip_mcast="true"
                           mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
                           ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
                           loopback="false"/>
                      <PING timeout="2000" num_initial_members="3"/>
                      <MERGE2 min_interval="10000" max_interval="20000"/>
                      <FD shun="true"/>
                      <FD_SOCK/>
                      <VERIFY_SUSPECT timeout="1500"/>
                      <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" />
                      <UNICAST timeout="600,1200,2400,4800" />
                      <pbcast.STABLE desired_avg_gossip="400000"/>
                      <FC max_credits="2000000" min_threshold="0.10"/>
                      <FRAG2 frag_size="8192"/>
                      <pbcast.GMS join_timeout="5000" shun="true" print_local_addr="true"/>
                      <pbcast.STATE_TRANSFER/>
                   </config>
                </attribute>
                <attribute name="FetchInMemoryState">true</attribute>
                <attribute name="InitialStateRetrievalTimeout">15000</attribute>
                <attribute name="SyncReplTimeout">15000</attribute>
                <attribute name="LockAcquisitionTimeout">10000</attribute>
             </mbean>
          </server>
          
          • 2. Re: "Unable to acquire lock on Fqn" exception with clustered Pojocache
            brettcave

            Seems to be caused by a bug:

             

            https://jira.jboss.org/jira/browse/JBCACHE-1565

             

             

            1. configure pojocache using JBossTransactionManager and run in a clustered environment

            2. attach an object to the cache.

             

            Exception about not being able to acquire lock on Fqn is thrown.