Java 点火螺纹异常;sun.misc.Unsafe.park“;停止处理请求

Java 点火螺纹异常;sun.misc.Unsafe.park“;停止处理请求,java,ignite,Java,Ignite,我有2个ignite客户端(2个IDEA项目在一台笔记本电脑上运行)+2个ignite服务器(2个linux虚拟机) 当我试图发送一些请求以从ignite缓存获取信息时,它会转储,但出现以下异常: [02:45:24,915][WARNING][grid-timeout-worker-#23][diagnostic] Found long running cache future [startTime=02:44:12.514, curTime=02:45:24.904, fut=GridNea

我有2个ignite客户端(2个IDEA项目在一台笔记本电脑上运行)+2个ignite服务器(2个linux虚拟机)

当我试图发送一些请求以从ignite缓存获取信息时,它会转储,但出现以下异常:

[02:45:24,915][WARNING][grid-timeout-worker-#23][diagnostic] Found long running cache future [startTime=02:44:12.514, curTime=02:45:24.904, fut=GridNearAtomicSingleUpdateFuture [reqState=Primary [id=d42484f4-0e66-4e59-8258-7b10c6c41695, opRes=false, expCnt=-1, rcvdCnt=0, primaryRes=false, done=false, waitFor=null, rcvd=null], super=GridNearAtomicAbstractUpdateFuture [remapCnt=100, topVer=AffinityTopologyVersion [topVer=4, minorTopVer=0], remapTopVer=null, err=null, futId=92, super=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=1812798386]]]]
[02:45:25,004][WARNING][grid-timeout-worker-#23][G] >>> Possible starvation in striped pool.
    Thread name: sys-stripe-7-#8
    Queue: [Message closure [msg=GridIoMessage [plc=2, topic=TOPIC_CACHE, topicOrd=8, ordered=false, timeout=0, skipOnTimeout=false, msg=GridDhtAtomicSingleUpdateRequest [key=KeyCacheObjectImpl [part=239, val=null, hasValBytes=true], val=BinaryObjectImpl [arr= true, ctx=false, start=0], prevVal=null, super=GridDhtAtomicAbstractUpdateRequest [onRes=false, nearNodeId=null, nearFutId=0, flags=]]]], Message closure [msg=GridIoMessage [plc=2, topic=TOPIC_CACHE, topicOrd=8, ordered=false, timeout=0, skipOnTimeout=false, msg=GridNearAtomicUpdateResponse [nodeId=null, futId=92, errs=null, ret=GridCacheReturn [v=null, cacheObj=null, success=true, invokeRes=false, loc=true, cacheId=0], remapTopVer=null, nearUpdates=null, partId=239, mapping=null, nodeLeft=false, super=GridCacheIdMessage [cacheId=708740962]]]], Message closure [msg=GridIoMessage [plc=2, topic=TOPIC_CACHE, topicOrd=8, ordered=false, timeout=0, skipOnTimeout=false, msg=GridNearAtomicSingleUpdateRequest [key=KeyCacheObjectImpl [part=47, val=null, hasValBytes=true], super=GridNearAtomicSingleUpdateRequest [key=KeyCacheObjectImpl [part=47, val=null, hasValBytes=true], parent=GridNearAtomicAbstractSingleUpdateRequest [nodeId=null, futId=65569, topVer=AffinityTopologyVersion [topVer=4, minorTopVer=0], parent=GridNearAtomicAbstractUpdateRequest [res=null, flags=]]]]]], o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$DeferredUpdateTimeout@3f4991e7, Message closure [msg=GridIoMessage [plc=2, topic=TOPIC_CACHE, topicOrd=8, ordered=false, timeout=0, skipOnTimeout=false, msg=GridNearSingleGetRequest [futId=1524335645779, key=KeyCacheObjectImpl [part=119, val=null, hasValBytes=true], flags=1, topVer=AffinityTopologyVersion [topVer=4, minorTopVer=0], subjId=de46e275-9054-45ed-8e00-6ab2643a5904, taskNameHash=0, createTtl=-1, accessTtl=-1]]], Message closure [msg=GridIoMessage [plc=2, topic=TOPIC_CACHE, topicOrd=8, ordered=false, timeout=0, skipOnTimeout=false, msg=GridNearAtomicSingleUpdateRequest [key=KeyCacheObjectImpl [part=47, val=null, hasValBytes=true], super=GridNearAtomicSingleUpdateRequest [key=KeyCacheObjectImpl [part=47, val=null, hasValBytes=true], parent=GridNearAtomicAbstractSingleUpdateRequest [nodeId=null, futId=16417, topVer=AffinityTopologyVersion [topVer=4, minorTopVer=0], parent=GridNearAtomicAbstractUpdateRequest [res=null, flags=]]]]]]]
    Deadlock: false
    Completed: 73
Thread [name="sys-stripe-7-#8", id=19, state=WAITING, blockCnt=0, waitCnt=108]
        at sun.misc.Unsafe.park(Native Method)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:304)
        at o.a.i.i.util.future.GridFutureAdapter.get0(GridFutureAdapter.java:177)
        at o.a.i.i.util.future.GridFutureAdapter.get(GridFutureAdapter.java:140)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.put0(GridDhtAtomicCache.java:613)
        at o.a.i.i.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2369)
        at o.a.i.i.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2346)
        at o.a.i.i.processors.cache.IgniteCacheProxyImpl.put(IgniteCacheProxyImpl.java:1026)
        at o.a.i.i.processors.cache.GatewayProtectedCacheProxy.put(GatewayProtectedCacheProxy.java:886)
        at com.test.match.MarketEventHandler.genReport(MarketEventHandler.java:67)
        at com.test.match.TestMatchBasicExecutor.matchCurrentLevel(TestMatchBasicExecutor.java:225)
        at com.test.match.TestMatchBasicExecutor$matchEntryProcessor.process(TestMatchBasicExecutor.java:469)
        at com.test.match.TestMatchBasicExecutor$matchEntryProcessor.process(TestMatchBasicExecutor.java:408)
        at o.a.i.i.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.runEntryProcessor(GridCacheMapEntry.java:5142)
        at o.a.i.i.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.call(GridCacheMapEntry.java:4550)
        at o.a.i.i.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.call(GridCacheMapEntry.java:4367)
        at o.a.i.i.processors.cache.persistence.tree.BPlusTree$Invoke.invokeClosure(BPlusTree.java:3051)
        at o.a.i.i.processors.cache.persistence.tree.BPlusTree$Invoke.access$6200(BPlusTree.java:2945)
        at o.a.i.i.processors.cache.persistence.tree.BPlusTree.invokeDown(BPlusTree.java:1717)
        at o.a.i.i.processors.cache.persistence.tree.BPlusTree.invoke(BPlusTree.java:1600)
        at o.a.i.i.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke(IgniteCacheOffheapManagerImpl.java:1199)
        at o.a.i.i.processors.cache.IgniteCacheOffheapManagerImpl.invoke(IgniteCacheOffheapManagerImpl.java:345)
        at o.a.i.i.processors.cache.GridCacheMapEntry.innerUpdate(GridCacheMapEntry.java:1767)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2420)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.update(GridDhtAtomicCache.java:1883)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1736)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal(GridDhtAtomicCache.java:1628)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.processNearAtomicUpdateRequest(GridDhtAtomicCache.java:3055)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.access$400(GridDhtAtomicCache.java:130)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$5.apply(GridDhtAtomicCache.java:266)
        at o.a.i.i.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$5.apply(GridDhtAtomicCache.java:261)
        at o.a.i.i.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:1060)
        at o.a.i.i.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:579)
        at o.a.i.i.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:378)
        at o.a.i.i.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:304)
        at o.a.i.i.processors.cache.GridCacheIoManager.access$100(GridCacheIoManager.java:99)
        at o.a.i.i.processors.cache.GridCacheIoManager$1.onMessage(GridCacheIoManager.java:293)
        at o.a.i.i.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
        at o.a.i.i.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
        at o.a.i.i.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
        at o.a.i.i.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
        at o.a.i.i.util.StripedExecutor$Stripe.run(StripedExecutor.java:505)
        at java.lang.Thread.run(Thread.java:748)
上述代码例外情况如下:

// TestMatchBasicExecutor.java:469
private static class matchEntryProcessor implements EntryProcessor<
    String, TestTradeCoinInfo, TestTradeCoinInfo> {

@Override
public TestTradeCoinInfo process(
        MutableEntry<String, TestTradeCoinInfo> entry, Object... args) {

    Ignite ignite = (Ignite) args[0];
    TestMatchEntrustInfo testMatchEntrustInfo = (TestMatchEntrustInfo) args[1];
    TestMatchEventHandler handler = (TestMatchEventHandler) args[2];

    TestTradeCoinInfo testTradeCoinInfo = entry.getValue();

...
    // TestMatchBasicExecutor.java:469
    if (false == matchTest(testMatchEntrustInfo, priceLevel, handler)) { 
        return null;
    }

...

    entry.setValue(testTradeCoinInfo);

    return null;
}
}



public static boolean matchTest(TestMatchEntrustInfo testInfo,
                                    MatchPriceLevel matchPriceLevel,
                                    TestMatchEventHandler eventHandler) {
...

eventHandler.genReport(testInfo,
        pendingInfo,
        amount,
        price);

...

}


public void genReport(TestMatchEntrustInfo primary, TestMatchEntrustInfo pending,
                  BigDecimal amount, BigDecimal price) {

String txCoinType = primary.getTxCoinType();

TestMatchResultRecord record = new TestMatchResultRecord();
record.genMatchResultRecord(primary, pending, amount, price);

// Add to another queue, and exit quickly to avoid dead lock
IgniteQueue<TestMatchResultRecord> reportQueue =
        ignite.queue("ResultRecordQueue_" + txCoinType, 0, null);
reportQueue.put(record);

}
//TestMatchBasicExecutor.java:469
私有静态类matchEntryProcessor实现EntryProcessor<
字符串,TestTradeCoinInfo,TestTradeCoinInfo>{
@凌驾
公共TestTradeCoinInfo进程(
可变项,对象…参数){
Ignite Ignite=(Ignite)args[0];
TestMatchTrustInfo TestMatchTrustInfo=(TestMatchTrustInfo)参数[1];
TestMatchEventHandler=(TestMatchEventHandler)args[2];
TestTradeCoinInfo TestTradeCoinInfo=entry.getValue();
...
//TestMatchBasicExecutor.java:469
if(false==matchTest(testmatchinfo,priceLevel,handler)){
返回null;
}
...
entry.setValue(testTradeCoinInfo);
返回null;
}
}
公共静态布尔匹配测试(TestMatchInfo testInfo,
匹配价格级别匹配价格级别,
TestMatchEventHandler(事件处理程序){
...
genReport(testInfo,
pendingInfo,
数量
价格);
...
}
public void genReport(TestMatchTruditInfo主、TestMatchTruditInfo挂起、,
大小数金额,大小数价格){
字符串txointype=primary.gettxointype();
TestMatchResultRecord记录=新的TestMatchResultRecord();
record.genMatchResultRecord(主要、待定、金额、价格);
//添加到另一个队列,并快速退出以避免死锁
IgniteQueue报告队列=
queue(“ResultRecordQueue”+txCoinType,0,null);
reportQueue.put(记录);
}
我使用ignite EntryProcessor来处理我的数据,之前在genReport中它还有另一个缓存使用EntryProcessor,它总是失败,所以我使用
ignite queue将记录保存到队列并在另一个服务线程中处理该记录,但在更改后,它会发出abvoe异常,并拒绝再处理任何其他请求

您不应在
EntryProcessor
中执行同步
put()
。处理器已在锁中调用,因此这可能导致死锁和/或线程不足


如果需要更新已处理的条目,请使用
MutableEntry#setValue(..)
您不应该在
EntryProcessor
中执行同步
put()
。处理器已在锁中调用,因此这可能导致死锁和/或线程不足

如果需要更新已处理的条目,请使用
MutableEntry#setValue(..)