首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ehcache 2.9.0中的ehcache死锁

Ehcache 2.9.0中的ehcache死锁
EN

Stack Overflow用户
提问于 2017-05-21 20:46:26
回答 1查看 786关注 0票数 0

我们有使用ehcache 2.9.0的应用程序。最近,我们观察到与ehcache get/put操作相关的死锁,每周一次,一旦我们清除了缓存,这个问题就消失了。

我们在缓存get操作期间观察到RandomAccessFile上的锁定,在put操作期间观察到ReentrantReadWriteLock上的锁定。

询问ehcache专家对可能存在的问题的见解?

PFB线程转储中的线程

"HTTP938“#25950 java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync) prio=5 os_prio=0 tid=0x0000000002614000 nid=0x5a64 waiting on condition 0x00007fcd36965000 java.lang.Thread.State: WAITING ( parking ) at sun.misc.Unsafe.park(本地方法)-parking to wait <0x00000005cbbc6768> (在java.util.concurrent.locks.AbstractQueuedSynchronizer.的java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)等待守护进程)doAcquireShared(AbstractQueuedSynchronizer.java:967) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1283) at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:727) at net.sf.ehcache.store.disk.Segment.flush(Segment.java:1010) at net.sf.ehcache.store.disk.DiskStore.flush(DiskStore.java:248) at net.sf.ehcache.store.CacheStore$1.evicted(CacheStore.java:99) atnet.sf.ehcache.store.CacheStore$1.evicted(CacheStore.java:96)在net.sf.ehcache.store.cachingtier.OnHeapCachingTier$1.evicted(OnHeapCachingTier.java:86)在net.sf.ehcache.store.cachingtier.CountBasedBackEnd$1.removed(CountBasedBackEnd.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.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)的org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

"HTTP927“#25855守护程序prio=5 os_prio=0 tid=0x00007fce685c9000 nid=0x4fb6正在等待监视器条目0x00007fcd359e8000 java.lang.Thread.State:在net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:362)被阻塞(在对象监视器上)-等待在net.sf.ehcache.store.disk.Segment.decode(Segment.java:171)在net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:864)锁定<0x00000005cbdfb538> (a java.io.RandomAccessFile)at net.sf.ehcache.store.disk.Segment.remove(Segment.java:644) at net.sf.ehcache.store.disk.DiskStore.remove(DiskStore.java:625) at net.sf.ehcache.store.CacheStore.remove(CacheStore.java:236) at net.sf.ehcache.Cache.removeInternal(Cache.java:2401) at net.sf.ehcache.Cache.tryRemoveImmediately(Cache.java:2162) at net.sf.ehcache.Cache.get(Cache.java:1739年)在org.springframework.cache.ehcache.EhCacheCache.get(EhCacheCache.java:65) at org.springframework.cache.interceptor.AbstractCacheInvoker.doGet(AbstractCacheInvoker.java:68) at org.springframework.cache.interceptor.CacheAspectSupport.findInCaches(CacheAspectSupport.java:461) at org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:432) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:333) at org.springframework.cache.interceptor.CacheAspectSupport.在org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)执行(CacheAspectSupport.java:299)

线程在java.io.RandomAccessFile.readFully(RandomAccessFile.java:416)上拥有监视器锁0x00000005cbdfb538 -在org.springframework.cache.ehcache.EhCacheCache.put(EhCacheCache.java:82)上锁定了HTTP762 0x00000005cbdfb538谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-05-22 11:37:40

我可能遗漏了一些东西,但我没有在您显示的线程转储中看到任何死锁。只有两个线程在等待不同的东西,而不是持有另一个线程。

第一次尝试必须逐出一个put上的值。

第二个线程注意到一个条目已过期,并将其从磁盘存储中删除。

您确定不是磁盘本身或缓存中的数据结构导致磁盘速度变慢?

我还建议迁移到2.10.4版本,这可能会使问题消失。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44097031

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档