Chronicle-Map
Chronicle-Map copied to clipboard
Failed to acquire the lock
Hi,
I am getting the below error sometimes, when i am trying to add about 1.5 million objects in the map using about 20 threads.
each thread fetches a list of objects and adds it to the map:
dataList.parallelStream().forEach(data -> offHeapCAMap.put(data.getId(), data));
I am persisting the map to the disk and used by only single JVM. I delete the persisted file every time a new process starts. i.e. it starts afresh.
Map Config:
ChronicleMapBuilder<Long, Data> mapBuilder=ChronicleMapBuilder.of(Long.class, Data.class)
.name("data-map")
.averageValueSize(30000)
.entries(1500000).putReturnsNull(true).maxBloatFactor(2);
ERROR:
Caused by: java.lang.IllegalStateException: Failed to acquire the lock
at net.openhft.chronicle.algo.locks.AcquisitionStrategies$SpinLoopOrFailAcquisitionStrategy.end(AcquisitionStrategies.java:89)
at net.openhft.chronicle.algo.locks.AcquisitionStrategies$SpinLoopAcquisitionStrategy.acquire(AcquisitionStrategies.java:66)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.globalMutableStateLock(VanillaChronicleHash.java:736)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.allocateTier(VanillaChronicleHash.java:760)
at net.openhft.chronicle.map.impl.CompiledMapQueryContext.nextTier(CompiledMapQueryContext.java:3123)
at net.openhft.chronicle.map.impl.CompiledMapQueryContext.alloc(CompiledMapQueryContext.java:3484)
at net.openhft.chronicle.map.impl.CompiledMapQueryContext.initEntryAndKey(CompiledMapQueryContext.java:3502)
at net.openhft.chronicle.map.impl.CompiledMapQueryContext.putEntry(CompiledMapQueryContext.java:3995)
at net.openhft.chronicle.map.impl.CompiledMapQueryContext.doInsert(CompiledMapQueryContext.java:4184)
at net.openhft.chronicle.map.MapEntryOperations.insert(MapEntryOperations.java:153)
at net.openhft.chronicle.map.impl.CompiledMapQueryContext.insert(CompiledMapQueryContext.java:4107)
at net.openhft.chronicle.map.MapMethods.put(MapMethods.java:88)
at net.openhft.chronicle.map.VanillaChronicleMap.put(VanillaChronicleMap.java:712)
I dont think it is related to volume of objects. I noticed its happening with 30K objects too.
I'm also getting the same error frequently. Any solution yet?
Where is the chronicle map file stored. Is it on the local disk. ?
Yes, it's on the local disk
I am getting the same error.. Error is same but at Chroniclemap.compute. I am using 3.14.5 version. Tried to update version but it did not solve the issue. The map is saved to disk in my case ; how to reproduce the issue- This occurs randomly and possibly with a large data set .Any suggestions or workarounds?
Exception in thread "main" java.lang.IllegalStateException: Failed to acquire the lock
| at net.openhft.chronicle.algo.locks.AcquisitionStrategies$SpinLoopOrFailAcquisitionStrategy.end(AcquisitionStrategies.java:89) | | at net.openhft.chronicle.algo.locks.AcquisitionStrategies$SpinLoopOrFailAcquisitionStrategy.end(AcquisitionStrategies.java:89) | at net.openhft.chronicle.algo.locks.AcquisitionStrategies$SpinLoopAcquisitionStrategy.acquire(AcquisitionStrategies.java:66) | | at net.openhft.chronicle.algo.locks.AcquisitionStrategies$SpinLoopAcquisitionStrategy.acquire(AcquisitionStrategies.java:66) | at net.openhft.chronicle.hash.impl.VanillaChronicleHash.globalMutableStateLock(VanillaChronicleHash.java:736) | | at net.openhft.chronicle.hash.impl.VanillaChronicleHash.globalMutableStateLock(VanillaChronicleHash.java:765) | at net.openhft.chronicle.hash.impl.VanillaChronicleHash.allocateTier(VanillaChronicleHash.java:760) | | at net.openhft.chronicle.hash.impl.VanillaChronicleHash.allocateTier(VanillaChronicleHash.java:787) | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.nextTier(CompiledMapQueryContext.java:3123) | | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.nextTier(CompiledMapQueryContext.java:3126) | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.alloc(CompiledMapQueryContext.java:3484) | | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.alloc(CompiledMapQueryContext.java:3487) | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.initEntryAndKey(CompiledMapQueryContext.java:3502) | | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.initEntryAndKey(CompiledMapQueryContext.java:3505) | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.putEntry(CompiledMapQueryContext.java:3995) | | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.putEntry(CompiledMapQueryContext.java:3998) | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.doInsert(CompiledMapQueryContext.java:4184) | | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.doInsert(CompiledMapQueryContext.java:4187) | at net.openhft.chronicle.map.MapEntryOperations.insert(MapEntryOperations.java:153) | | at net.openhft.chronicle.map.MapEntryOperations.insert(MapEntryOperations.java:157) | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.insert(CompiledMapQueryContext.java:4107) | | at net.openhft.chronicle.map.impl.CompiledMapQueryContext.insert(CompiledMapQueryContext.java:4110) | at net.openhft.chronicle.map.MapMethods.put(MapMethods.java:88) | | at net.openhft.chronicle.map.MapMethods.compute(MapMethods.java:350) | at net.openhft.chronicle.map.VanillaChronicleMap.put(VanillaChronicleMap.java:712) | | at net.openhft.chronicle.map.VanillaChronicleMap.compute(VanillaChronicleMap.java:747)
This is related to https://github.com/OpenHFT/Chronicle-Map/issues/376
@amritkumar123 @amandeep0440 @ksiu could you re-rest now that #376 has been fixed?
Closing as assumed fixed by #376