Closed glentakahashi closed 1 year ago
Did you modify the modpack in any way?
Did you update any mods manually?
Follow this guide. https://github.com/etil2jz/etil-minecraft-flags
If the lag persists set maxticktime in server.properties to -1
and then run the command /spark profiler --interval 100
Aha, i think i figured out the cause. using Spark never helped because it froze the entire thread and never returned so i couldn't get a profile. However I was able to take stack traces using jstack
and found that in the 3 times that the game froze it was stuck on com.telepathicgrunt.repurposedstructures.misc.maptrades.StructureSpecificMaps$TreasureMapForEmeralds.method_7246(StructureSpecificMaps.java:68)
I dug into that source code and found https://github.com/TelepathicGrunt/RepurposedStructures/blob/71839a80a79a34089ac89e47c6eb48d310447a78/src/main/java/com/telepathicgrunt/repurposedstructures/misc/maptrades/StructureSpecificMaps.java#L89
This led me to do some more searching and I found this bug https://bugs.mojang.com/browse/MC-249136 that seems related and the exact same behavior I noticed as well.
I /think/ i fixed it (edit: ran chunk gen for 6 hours without any crashes) by making a custom datapack which removes map trades from villagers for Repurposed Structures. Repurposed_Structures-NoMaps.zip I also added https://github.com/PaperMC/Paper/issues/2312#issuecomment-673210233 just in case, although I wasn't particularly seeing issues with that afaict.
@glentakahashi I’m the dev for Repurposed Structures. I had tested my structures before and they have been spawning so my first thing is this is something unique to your world or pack.
Go into your game and use /locate command on these structure tags/structures until you get a deadlock and tell me which one is causing the game to tp get stuck longer than 30 seconds. https://github.com/TelepathicGrunt/RepurposedStructures/blob/latest-released-Forge/src/main/resources/data/repurposed_structures/structure_map_trades/default_maps.json
the only way this can happen is if the biomes that the structure can spawn in is in the world’s biome source’s possible biomes field but the biome source is not actually spawning the biomes or conditions are never right for the structure.
For example, Jungle Fortress needs a decent area to be all jungle to fit the structure in. If you have something messing with biome size and making microbiomes, there won’t be a large enough jungle area for it so the game gets stuck searching forever.
So first, find exactly what structure tag is deadlocking your game and then I can explain the conditions those structures needs and then we can look closer at the world generation going on.
Ah @TelepathicGrunt that might explain it then, searching for the collections/
ones happens instantly, but it doesn't work at all for the other tags. Maybe this modpack removed them or they're not available for some reason? I get the message There is no structure with type #repurposed_structures:fortress_jungle
@chorbintime does this modpack disable/remove some structures or am i doing something wrong in querying them
Edit: nevermind i was querying it wrong. I searched for all the structures and they worked relatively instantly. Should i be testing this from far away from spawn?
Then the structures are spawning, working, and locatable. This then points to something messing with the explorer maps/wandering trader themselves. (Unless the issue is happening in a specific world and not new worlds created. If it is world specific, can you share the world?)
If you spawn the wandering trader by spawn egg and open their trades until you get one with an explorer map, does it deadlock then?
Hmm okay so i literally can't repro this any more which is super annoying, even though it used to happen constantly. I spun up new servers with the same seed, did the same pregenning, restored from a backup etc. and now it doesn't happen...
I also tried creating a ton of wandering traders and finding ones with maps, and I got some lag (like 1-2 seconds max) but nothing crazy like the 2 minutes i was seeing before.
I'm going to close out for now and will revisit in the future if i can get a repro, but i still have some leads to dig into
Describe the Bug
Randomly, although I seem to notice it more often when doing chunk generation (either via cli or just exploring in game), the server will seemingly just freeze on a tick for 120 seconds until the server crashes and restarts. The server logs don't have anything useful prior to the crash, and i haven't found anything in the crash reports either.
As an example of logs before a crash I usually see this
Reproduction Steps
No response
Screenshots and Videos
No response
Crash Report or Log
https://gist.github.com/glentakahashi/63b4ed5c9827c4bd586e435eecaca1d2
Operating System
linux (amazon linux 2)
Minecraft Version
1.19
Modloader
Fabric
Modpack Version
mmc v14.5
Optifine
No
Other Mods
No response