Server crashes when dropping items ouf of Barrel
marco-david opened this issue ยท 6 comments
In the Sky Factory 4 modpack, I have experienced a couple server crashes while emptying barrels. As long as the items go into the player's inventory all is fine, but as soon as the items drop into the world as Item Entities (e.g. because the player's inventory is full), they can crash the server.
The server crashes with a ConcurrentModificationException without referencing any mod's source code. Hence I am unsure if this is a forge issue or a Barrels, Drums, Storage and More issue. The following exception is thrown, taken from the full crash report (https://gist.github.com/marco-david/f3a721aa06dfcddf2d00365fac635c06).
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)
at java.util.HashMap$KeyIterator.next(HashMap.java:1469)
at net.minecraft.entity.EntityTracker.func_72788_a(EntityTracker.java:290)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:779)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
at java.lang.Thread.run(Thread.java:748)
Some testing so far has shown the following:
- The speed of item extraction does not matter.
- The server crashes as soon as three stacks of items (in my case cobblestone) fall onto roughly the same location (i.e. group up).
- Since items are dropped following the player's orientation; if moving between extracting stacks such that they do not group up, the issue does not happen.
I builded the fix code from theashenwolf
download link
https://github.com/anzaichiyomi2022/BarrelsDrumsStorageAndMore/releases/tag/fix
Experiencing this as well on SF4, though our server doesn't crash, just the user that did it gets booted.
Further notes:
- This issue also occurs when items are dropped individually out of a barrel. Here, however, around 10 items need to be dropped.
- This issue does not occur when manually dropping items out of the player's inventory.
- This issue also does not occur when dropping items with a full inventory through the Storage Remote from the Simple Storage Network mod.
This provides some more evidence that Barrels, Drums, Storage and More might be responsible.
I wonder if I... oh... I see what I did. Yea this one is on me.
I forgot about thread safety when I changed the interaction controls to be handled by the networking. Sorta surprised this wasn't noticed way sooner before SF4's release honestly
Same here for me on SkyFactory 4. Running your mod 0.0.24, server crash when I take too many out too fast I think.
@Funwayguy What's the status on this issue?