以下是我的配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:4.2 http://www.infinispan.org/schemas/infinispan-config-4.2.xsd"
xmlns="urn:infinispan:config:4.2">
<global>
<transport clusterName="DEV2" transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport">
<properties>
<property name="configurationFile" value="../jgroups-tcp.xml" />
</properties>
</transport>
</global>
<default>
<clustering mode="distribution">
<l1 enabled="false"/>
<hash numOwners="1" rehashRpcTimeout="120000"/>
<sync/>
</clustering>
<eviction strategy="FIFO" maxEntries="1"/>
<expiration lifespan="1000" maxIdle="500" />
</default>
</infinispan>
以下是我的异常追踪:
Caused by: org.infinispan.util.concurrent.TimeoutException: Unable to acquire lock after [10 seconds] on key [178328] for requestor [Thread[http-10.226.32.128-5000-Processor10,5,main]]! Lock held by [(another thread)]
答案 0 :(得分:3)
我配置了锁定属性useLockStriping =“false”。这将为添加到缓存的每个条目创建一个锁。这解决了我的问题