2017-05-21 1 views
0

Nous avons l'application en utilisant ehcache 2.9.0. Dernièrement, nous avons observé des blocages liés aux opérations get/put d'ehcache une fois par semaine, et une fois que nous avons effacé le cache, le problème disparaît.Ehcache Deadlock dans ehcache 2.9.0

nous observons le verrou sur le RandomAccessFile lors de l'opération get cache et ReentrantReadWriteLock pendant l'opération put.

Demandez des informations aux experts d'ehcache sur ce qui pourrait être un problème?

PFB les filets du filetage décharges

"HTTP938" daemon # 25950 prio = 5 os_prio = 0 tid = 0x0000000002614000 nid = 0x5a64 attente à la condition [0x00007fcd36965000] java.lang.Thread.State: ATTENTE (parking) à sun.misc.Unsafe.park (méthode native) - parking à attendre < 0x00000005cbbc6768> (un java.util.concurrent.locks.ReentrantReadWriteLock $ NonfairSync) à java.util.concurrent.locks.LockSupport. parc (LockSupport.java:175) à java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt (AbstractQueuedSynchronizer.java:836) à j ava.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared (AbstractQueuedSynchronizer.java:967) à java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared (AbstractQueuedSynchronizer.java:1283) à java.util.concurrent.locks.ReentrantReadWriteLock $ ReadLock.lock (ReentrantReadWriteLock.java:727) à net.sf.ehcache.store.disk.Segment.flush (Segment.java:1010) à net.sf.ehcache.store.disk.DiskStore.flush (DiskStore. java: 248) à net.sf.ehcache.store.CacheStore $ 1.evicted (CacheStore.java:99) à net.sf.ehcache.store.CacheStore $ 1.évalué (CacheStore.java:96) au net. sf.ehcache.store.cachingtier.OnHeapCachingTier $ 1.evicted (OnHeapCachingTier.java:86) à net.sf.ehcache.store.cachingtier.CountBasedBackEnd $ 1. supprimé (CountBase dBackEnd.java:103) à net.sf.ehcache.util.concurrent.ConcurrentHashMap.internalReplace (ConcurrentHashMap.java:1346) à net.sf.ehcache.util.concurrent.ConcurrentHashMap.removeAndNotify (ConcurrentHashMap.java:2647) à net.sf.ehcache.store.cachingtier.CountBasedBackEnd.remove (CountBasedBackEnd.java:115) à net.sf.ehcache.store.cachingtier.OnHeapCachingTier.remove (OnHeapCachingTier.java:206) à net.sf. ehcache.store.CacheStore.put (CacheStore.java:134) à net.sf.ehcache.Cache.putInternal (Cache.java:1600) à net.sf.ehcache.Cache.put (Cache.java:1526) à net.sf.ehcache.Cache.put (Cache.java:1491) à org.springframework.cache.ehcache.EhCacheCache.put (EhCacheCache.java:82) à org.springframework.cache.interceptor.AbstractCacheInvoker.doPut (AbstractCacheInvoker.java:82) à org.springframework.cache.interceptor.CacheAspectSupport $ CachePutRequest.apply (CacheAspectSupport.java:651) à org.springframework.cache.interceptor .CacheAspectSupport.execute (CacheAspectSupport.java:358) à org.springframework.cache.interceptor.CacheAspectSupport.execute (CacheAspectSupport.java:299) à org.springframework.cache.interceptor.CacheInterceptor.invoke (CacheInterceptor.java:61) à org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (ReflectiveMethodInvocation.java:179) à org.springframework.aop.framework.CglibAopProxy $ DynamicAdvisedInterceptor.intercept (CglibAopProxy.java:653)

"HTTP927" # 25855 daemon prio = 5 os_prio = 0 tid = 0x00007fce685c9000 nid = 0x4fb6 en attente de l'entrée du moniteur [0x00007fcd359e8000] java.lang.Thread.État: BLOQUE (sur le moniteur d'objet) à net.sf.ehcache.store.disk.DiskStorageFactory.read (DiskStorageFactory.java:362) - attente pour verrouiller < 0x00000005cbdfb538> (un java.io.RandomAccessFile) au filet. sf.ehcache.store.disk.DiskStorageFactory.retrieve (DiskStorageFactory.java:864) à net.sf.ehcache.store.disk.Segment.decode (Segment.java:171) à net.sf.ehcache.store. disk.Segment.remove (Segment.java:644) sur net.sf.ehcache.store.disk.DiskStore.remove (DiskStore.java:625) sur net.sf.ehcache.store.CacheStore.remove (CacheStore. java: 236) à net.sf.ehcache.Cache.removeInternal (Cache.java:2401) à net.sf.ehcache.Cache.tryRemoveImmediately (Cache.java:2162) à net.sf.ehcache.Cache.get (Cache.java:1739) à org.springframework.cache.ehcache.EhCacheCache.get (EhCacheCache.java:65) à org.springframework.cache.interceptor.AbstractCacheInvoker.doGet (AbstractCacheInvoker.java:68) à org.springframework.cache.interceptor.CacheAspectSupport.findInCaches (CacheAspectSupport.java:461) à org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem (CacheAspectSupport.java:432) à org. springframework.cache.interceptor.CacheAspectSupport.execute (CacheAspectSupport.java:333) à org.springframework.cache.interceptor.CacheAspectSupport.execute (CacheAspectSupport.java:299) à org.springframework.cache.interceptor.CacheInterceptor.invoke (CacheInterceptor.java:61) à org.springframework.aop.fr amework.ReflectiveMethodInvocation.proceed (ReflectiveMethodInvocation.java:179) à org.springframework.aop.framework.CglibAopProxy $ DynamicAdvisedInterceptor.intercept (CglibAopProxy.java:653)

Discussion HTTP762 Owns moniteur de verrouillage sur 0x00000005cbdfb538 à java. io.RandomAccessFile.readFully (RandomAccessFile.java:416) - verrouillés [0x00000005cbdfb538] (un java.io.RandomAccessFile) à org.springframework.cache.ehcache.EhCacheCache.put (EhCacheCache.java:82) Merci, Nivedita

Répondre

0

Je pourrais manquer quelque chose, mais je ne vois pas d'impasse dans le th Lire la décharge que vous montrez. Seulement deux threads attendent sur des choses différentes mais ne tiennent pas de l'autre thread.

Les premiers essais ont dû expulser une valeur sur un put.

Le deuxième thread remarque qu'une entrée a expiré et est supprimée du stockage sur disque.

Etes-vous sûr que ce n'est pas le disque qui ralentit en raison du disque lui-même ou de la structure des données dans le cache?

Je recommande également de passer à la version 2.10.4 qui pourrait faire disparaître le problème.

+0

Il y avait 39 threads en attente de verrouillage acquis par la mise en cache. –

+0

Le cache est-il terminé à un moment donné? Ou c'est la même chose sans fin? Qui verrouille 0x00000005cbdfb538? – Henri

+0

Je trouve le 0x00000005cbdfb538 est verrouillé par Cache PUt –