ConcurrentModificationException will be reported when concurrent
Jude95 opened this issue ยท 9 comments
Jude95 commented
java.util.ConcurrentModificationException
java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:756)
java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:778)
io.github.reactivecircus.cache4k.RealCache.expireEntries(RealCache.kt:174)
io.github.reactivecircus.cache4k.RealCache.put(RealCache.kt:120)
Shabinder commented
+1:
java.util.ConcurrentModificationException at
java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:760) at
java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:782) at
kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:272) at
io.github.reactivecircus.cache4k.RealCache.evictEntries(RealCache.kt:206) at
io.github.reactivecircus.cache4k.RealCache.put(RealCache.kt:140)
ychescale9 commented
I think we need to revert back to using stately
which is thread-safe on JVM.
Shabinder commented
@ychescale9 will you be making a release anytime soon ?
ychescale9 commented
I'll try to find some time in the coming weeks.
luca992 commented
ychescale9 commented
Thanks, will look into it.
hoc081098 commented
+1 for Ktor Utils Collections ๐
ychescale9 commented
looks like ktor's ConcurrentMap
just delegates to ConcurrentHashMap
on JVM which I've done in #39, though there are still some linearizability issues surfaced by Lincheck. Maybe we can land that change now and deal with the remaining issues later as they are not regressions.
ychescale9 commented
Just released 0.13.0 with ConcurrentHashMap
on JVM. Please let me know if this fixes the issue.