所以我们使用的是 Guava v18。我们将使用此内容进行很多线程:
"catalina-exec-ajp2" daemon prio=10 tid=0x00007fb45c001800 nid=0x18aa waiting on condition [0x00007fb435151000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000075ff0cfe8> (a com.google.common.util.concurrent.AbstractFuture$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:285)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
at com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:137)
at com.google.common.cache.LocalCache$LoadingValueReference.waitForValue(LocalCache.java:3557)
at com.google.common.cache.LocalCache$Segment.waitForLoadingValue(LocalCache.java:2302)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2191)
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)
at com.xxx.yyy.repository.cache.acl.guava.GuavaCacheWrapper.get(GuavaCacheWrapper.java:21)
at com.xxx.yyy.repository.cache.CachedCpaRepository.findAll(CachedCpaRepository.java:32)
我们的番石榴配置是:
@SuppressWarnings("unchecked")
@Override
protected <K, R> CacheWrapper<K, R> newCacheConfiguration(Fetcher fetcher, String cacheName, int maxElementsInMemory,
int timeToIdleSeconds, int timeToLiveSeconds)
{
Cache existingCache = manager.getCache(cacheName);
CacheWrapper<K, R> cache;
if(null == existingCache)
{
cache = new GuavaCacheWrapper<>(CacheBuilder.newBuilder()
.maximumSize(maxElementsInMemory)
.expireAfterAccess(timeToIdleSeconds, SECONDS)
.refreshAfterWrite(timeToLiveSeconds, SECONDS)
.recordStats()
.build( CacheLoader.asyncReloading(fetcher.getAs(CacheLoader.class), executors)));
manager.addCache(cacheName, cache);
}
else
{
cache = (CacheWrapper<K, R>) ((GuavaCache) existingCache).getNativaGuavaCache();
}
return cache;
}
我对可以检查什么以查看导致问题的原因有点无能为力。你能建议我可以检查什么吗?