Frequent ConcurrentModificationException potentially breaks capabilities of other mods
andriihorpenko opened this issue ยท 6 comments
Issue type:
- ๐ Bug
Short description:
There is an ongoing issue with Mekanism (mekanism/Mekanism#7831) and after some investigation we located an exception thrown to the log on server boot. More specifically, a ConcurrentModificationException
exception with stacktrace pointing to CyclopsCore.
Little background: I run 5 servers and sometimes after a server reboot some Mekanism structure stop accepting liquid. I checked out logs of 5 servers and 3 out of 5 had a ConcurrentModificationException
thrown. Interestingly, servers with that exception had problems with Mekanism, while the rest of them had no issues. This suggests that that might be the actual root cause.
Steps to reproduce the problem:
Unfortunately, there are no specific reproduction steps and this happens inconsistently. This happens 1 out of 3 server boots.
Expected behaviour:
Not potentially breaking capabilities of other mods on server load.
Versions:
- This mod: 1.18.6
- Minecraft: 1.19.2
- Forge: 43.2.17
Log file:
Exceptions thrown on lines: 308, 400, 492
https://bytebin.lucko.me/zuCWjPaT0I
Hmm, something is definitely going wrong there indeed.
Note to self: bake
is being called multiple times in parallel. Fix locking: https://github.com/CyclopsMC/CyclopsCore/blob/721b3af7a807d01226f034b039d92d3882c2ea7e/src/main/java/org/cyclops/cyclopscore/modcompat/capabilities/CapabilityConstructorRegistry.java#L339C5-L339C25
@andriihorpenko The issue should be fixed in the last commit. Before I publish this release, could you try out the latest dev build to confirm that it fixes the problem on your end?
Sure, I will install it on all servers and let you know how it goes. It may take some time to test it out, hopefully not more than a day.
Thanks for a rapid response!
@rubensworks you can safely publish this build. There is no ConcurrentModificationException
exception present on any of my production servers.