Applied Energistics 2

Applied Energistics 2

137M Downloads

ConcurrentModificationException crash in AE2 under server high load.

skyline918 opened this issue ยท 3 comments

commented

Description
Having big server online (100/100) and big amount of active ME networks online java.util.ConcurrentModificationException can happen, I have SpongeForge, but there is no spongepowered code in stack trace I think because AE2 uses ASM. Also there are many same reports without SF. So, I think, SF is not reason of the crash. As I have understood LinkedHashMap implementation is not thread safe, but java.util.LinkedHashMap$LinkedHashIterator.remove method is called asynchronously somewhere. There is also Spongeforge warnings about that in server log like:

 [20:00:35] [Server Shutdown Thread/ERROR] [Sponge]: Detected attempt to add entity 'EntityItem['item.ic2.re_battery'/504329, l='world', x=-5505.54, y=76.32, z=534.26]' to ClassInheritanceMultiMap asynchronously.
 This is very bad as it can cause ConcurrentModificationException's during a server tick.

To Reproduce
Maybe simulate big player online on some server, or create huge network, I do not know tbh.

Expected behavior
No crash

  • Minecraft Version: 1.12.2
  • AE2 Version: Tested both on appliedenergistics2-rv6-stable-7.jar and appliedenergistics2-rv6-stable-6.jar
  • Forge Version: 2838
  • SpongeForge version: spongeforge-1.12.2-2838-7.1.9.jar
  • Java version: OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-1~deb9u1-b08)
  • Operating System: debian9.4, Intel i7-6700K - 32GB DDR4, dedicated server
  • jvm args (aikars): java -Xms10G -Xmx10G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AlwaysPreTouch -cp ...

Case with stable-6, having online 99/100 crash file

I have decided to update the mod, but no effect.

Plugins/Mods: all can be found in crash files
Case with stable-7, having online 59/100 crash file

Already happened 10-20 times for last 2 days, after around 1-3 hours of server online under high load

commented

[20:00:35] [Server Shutdown Thread/ERROR] [Sponge]: Detected attempt to add entity 'EntityItem['item.ic2.re_battery'/504329, l='world', x=-5505.54, y=76.32, z=534.26]' to ClassInheritanceMultiMap asynchronously.

I'm curious, are the Sponge errors always referring to 'item.ic2.re_battery' or are they different entities each time?

commented

Sorry, sponge is not supported. Try if you can reproduce this without. Also please use pastebin or similar for crashlogs and dont upload files like requested in the template

commented

No, there are many item types, I would upload latest.log but github gist tells that This page is taking too long to load. I will try again tomorrow.