ConcurrentModificationException errors
So today I finally released by bot to production, which was scary because it meant going from 3 servers to 16k servers... so of course I expected errors.
This error is popping up on various places on my bot when accessing stuff from Discord.
I'm using:
defaultStrategy = EntitySupplyStrategy.cacheWithCachingRestFallback
.
This is happening in various functions that interact with Discord data in some way, in the particular stacktrace I attached, it refers to this call:
This is happening in many different places, with stuff that interacts with the entity supplier or with Flows.48 Replies
That looks like a problem with Kord, so I'll have to defer to @Kord Team Members
While you wait, make sure you're using the latest KordEx snapshot and not providing your own Kord version
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
We should as I published 0.5.1 a few days ago
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
yeah I think this was largely resolved by changing it in kord, however cache doesn't change it for now
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I will give this a try
I'm actually in the 1.8.0 SNAPSHOT, tried 1.8.1, but I was getting these issues: https://canary.discord.com/channels/1121419906995458098/1252310860551028767
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
you got that while matching the kordex build environment?
is 0.5.1 not part of 0.14.0-SNAPSHOT?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
was there a new cycle that I missed?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Oh huh, was the new cycle announced?
Maybe I forgot about it
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
That's not explicit enough imo haha
But yeah, fair
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Yeah, I think there's been some releases I should test
But I kinda wanna get a web PoC merged first before I go doing more mainline
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Ah nice, that's good news
Thanks
Just switched to temurin image, added
useKSP2
and other gradle.properties flags you are using, Kotlin 1.9.22
But what I get is a different error:
(should I continue this specific discussion on the other thread or here?)The other thread if you would
javaslang/collection/HashMap 🤔
Huh, yeah
running with --stacktrace might help
Ok, I got over the KSP2 issues, I'm on 1.81 snapshot now. I upgraded kotlin (and ksp) to 1.9.24 and that did it.
Now, when trying to add kord cache, it is not resolved, am I missing a maven repository? I'm using the ones in Kord's README
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
The artifact stuff should be fixed in 5-10 mins, I am working on it, but Maven central changed their publishing and since different projects are on different hosts it caused issues
0.5.3 should be available in around 10 minutes (maven central sync) and then it should work
Solution
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
So I tried with
0.5.3
and it builds fine, but it fails on startup(fixed extension)
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
This is looking good, haven't seen any ConcurrentModificationExceptions so far, thanks!
I think the jdk concurrenthashmap can't even throw such an exception
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I mean the ConcurrentMutableMap is called concurrent too
I wonder how the ConcurrentHashMap works
since it's supposed to be lock free
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
I wonder whether that's a jvm specific bug or a general stately bug
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
GitHub
java.util.ConcurrentModificationException:, even when using statel...
Exception java.util.ConcurrentModificationException: at java.util.ArrayList$Itr.next (ArrayList.java:860) at co.touchlab.stately.collections.ConcurrentMutableIterator$next$1.invoke (ConcurrentMutab...
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
that makes sense
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
LockSupport 👀
wonder how loom changes it
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Yeah they rewrote LockSupport for loom
they said that in some talks