5 Replies Latest reply on Sep 14, 2007 8:13 AM by Manik Surtani

    Problem with concurent put/remove operation.

    Jacek Halat Newbie

      There is a problem with concurent put/remove operation in latest 1.4.1SP4 Cayenne version. When one thread is only removing and second only putting values into this same cache region, sometime put operation fails with exception:

      org.jboss.cache.NodeNotExistsException: node /a/b/c/d not found (gtx=GlobalTransaction::2, caller=Thread[Thread-0,5,main])
      at org.jboss.cache.TreeCache._put(TreeCache.java:4618)
      at org.jboss.cache.TreeCache._put(TreeCache.java:4579)
      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 org.jgroups.blocks.MethodCall.invoke(MethodCall.java:330)
      at org.jboss.cache.interceptors.CallInterceptor.invoke(CallInterceptor.java:52)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
      at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:89)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
      at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
      (...)
      Thread 1 is calling:

       cache.remove("/a/b/c/d");
       cache.remove("/a");
      

      and Thread 2 is calling:
       cache.putObject("/a/b/c/d", "text" + x);
      



      This same operations sequence fails too on latest 2.0.0.GA Habanero version but with another message:

      org.jboss.cache.pojo.PojoCacheException: detach /a/b/c/d failed
      at org.jboss.cache.pojo.impl.PojoCacheImpl.detach(PojoCacheImpl.java:158)
      at org.jboss.cache.pojo.impl.PojoCacheDelegate.putObjectII(PojoCacheDelegate.java:143)
      at org.jboss.cache.pojo.impl.PojoCacheImpl.putObject(PojoCacheImpl.java:136)
      at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:101)
      at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:93)
      at org.jboss.cache.aop.ConcurentOperationTest$WorkThread.run(ConcurentOperationTest.java:80)
      Caused by: org.jboss.cache.lock.UpgradeException: failure upgrading lock: fqn=/__JBossInternal__/a/b/c/d/_ID_/5c4o02w-youoh8-f5frdt5j-1-f5frdt5j-2, caller=GlobalTransaction:<192.168.0.104:4850>:6, lock=read owners=[GlobalTransaction:<192.168.0.104:4850>:5, GlobalTransaction:<192.168.0.104:4850>:6] (activeReaders=1, activeWriter=null, waitingReaders=0, waitingWriters=1, waitingUpgrader=1)
      at org.jboss.cache.lock.IdentityLock.acquire(IdentityLock.java:508)
      at org.jboss.cache.interceptors.PessimisticLockInterceptor$LockManager.acquire(PessimisticLockInterceptor.java:579)
      (...)