[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
offheap cache get blocking error  XML
Forum Index -> BigMemory
Author Message
lijie

journeyman

Joined: 09/04/2012 23:10:13
Messages: 19
Offline

We create an offheap cache.(ehcache-ee-2.7.0.jar and ehcache-ee-2.8.2.jar)
Then get and put data at the sometime(some data are duplicating), sometime our system blocked and can't get/put data from the cache.

The thread dump in the attach.

the information like :

at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.getAndSetMetadata(AbstractLockedOffHeapHashMap.java:280)
at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.put(AbstractLockedOffHeapHashMap.java:130)
at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.put(AbstractLockedOffHeapHashMap.java:130)
at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.put(AbstractLockedOffHeapHashMap.java:130)
at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.put(AbstractLockedOffHeapHashMap.java:130)
at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.put(AbstractLockedOffHeapHashMap.java:130)
 


Any ideas? Thanks.
 Filename threaddump.rar [Disk] Download
 Description
 Filesize 56 Kbytes
 Downloaded:  481 time(s)

cdennis

master

Joined: 01/19/2009 10:03:26
Messages: 89
Offline

I've looked over the thread dumps here and I see no evidence of any kind of deadlock occurring in the product. I do see that you are using explicit locking on the cache - one thing that could cause this issue would be if there were unbalanced lock/unlock calls through the explicit locking API. It would be likely be worth your while to double check all of your code that interacts with the explicit locking API to confirm that there are no errors there.

Also, if you are a paying customer and have a support contract with us, it would definitely be best to pursue this through the regular support channels.

Chris

Chris Dennis (Terracotta Engineer)
lijie

journeyman

Joined: 09/04/2012 23:10:13
Messages: 19
Offline

cdennis wrote:
I've looked over the thread dumps here and I see no evidence of any kind of deadlock occurring in the product. I do see that you are using explicit locking on the cache - one thing that could cause this issue would be if there were unbalanced lock/unlock calls through the explicit locking API. It would be likely be worth your while to double check all of your code that interacts with the explicit locking API to confirm that there are no errors there.

Also, if you are a paying customer and have a support contract with us, it would definitely be best to pursue this through the regular support channels.

Chris 


Thanks for your reply.
Some time ago, we didn't using explicit lock, and had the problem.
Then we add the explicit locking, Code:
 put data
 try{
     cache.acquireWriteLockOnKey(ele.getObjectKey());
     cache.put(ele);
 }finally{
     cache.releaseWriteLockOnKey(ele.getObjectKey());
 }
 ---------------------------------------------
 get data
 try{
     cache.acquireReadLockOnKey(key);
     ele = cache.get(key);
 }
 finally{
     cache.releaseReadLockOnKey(key);
 }
 


Other I feel confused that why the put/get cache is blocking at AbstractLockedOffHeapHashMap?
at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.put(AbstractLockedOffHeapHashMap.java:130)

at com.terracottatech.offheapstore.AbstractLockedOffHeapHashMap.getAndSetMetadata(AbstractLockedOffHeapHashMap.java:280)


Who hold the lock in the AbstractLockedOffHeapHashMap and not release?
 
Forum Index -> BigMemory
Go to:   
Powered by JForum 2.1.7 © JForum Team