Alex's Mobs

Alex's Mobs

72M Downloads

World Deadlock Due to mobs spawning in unloaded/ungenerated chunks 1.20.1

Zelioth opened this issue ยท 0 comments

commented

Forge 47.1.47
MC - 1.20.1
Alex's Mobs 1.22.5

Looks like with Alex mobs activated while generating new chunks you can get a complete deadlock of world gen.

When the deadlock happened I did a thread dump and found the worker thread stuck on attempting to generate an elephant in a chunk that wasn't loaded or generated.

I will include the thread plus the full dump

"Worker-Main-9" #237 daemon prio=4 os_prio=-1 cpu=21656.25ms elapsed=396.71s tid=0x000001d4fffa0590 nid=0x1868 waiting on condition [0x000000cb2defe000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
- parking to wait for <0x00000007e69e1d68> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:211)
at java.util.concurrent.CompletableFuture$Signaller.block([email protected]/CompletableFuture.java:1864)
at java.util.concurrent.ForkJoinPool.compensatedBlock([email protected]/ForkJoinPool.java:3449)
at java.util.concurrent.ForkJoinPool.managedBlock([email protected]/ForkJoinPool.java:3432)
at java.util.concurrent.CompletableFuture.waitingGet([email protected]/CompletableFuture.java:1898)
at java.util.concurrent.CompletableFuture.join([email protected]/CompletableFuture.java:2117)
at net.minecraft.server.level.ServerChunkCache.m_7587_([email protected]/ServerChunkCache.java:114)
at net.minecraft.world.level.Level.m_6522_([email protected]/Level.java:187)
at net.minecraft.world.level.LevelReader.m_46819_([email protected]/LevelReader.java:129)
at net.minecraft.world.level.Level.m_6325_([email protected]/Level.java:182)
at net.minecraft.world.level.Level.m_8055_([email protected]/Level.java:355)
at net.minecraft.world.level.LevelReader.m_46855_([email protected]/LevelReader.java:153)
at net.minecraft.world.entity.Mob.m_6914_([email protected]/Mob.java:841)
at com.github.alexthe666.alexsmobs.entity.EntityElephant.canSpawnWithTraderHere([email protected]/EntityElephant.java:1019)
at com.github.alexthe666.alexsmobs.event.ServerEvents.onEntityJoinWorld([email protected]/ServerEvents.java:495)
at com.github.alexthe666.alexsmobs.event.ServerEvents_onEntityJoinWorld_FinalizeSpawn.invoke([email protected]/.dynamic)
at net.minecraftforge.eventbus.ASMEventHandler.invoke(net.minecraftforge.eventbus/ASMEventHandler.java:73)
at net.minecraftforge.eventbus.EventBus$$Lambda$5123/0x0000000801027600.invoke(net.minecraftforge.eventbus/Unknown Source)
at net.minecraftforge.eventbus.EventBus.post(net.minecraftforge.eventbus/EventBus.java:315)
at net.minecraftforge.eventbus.EventBus.post(net.minecraftforge.eventbus/EventBus.java:296)
at net.minecraftforge.event.ForgeEventFactory.onFinalizeSpawn([email protected]/ForgeEventFactory.java:281)
at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.lambda$addEntitiesToWorld$5([email protected]/StructureTemplate.java:432)
at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate$$Lambda$64217/0x00000008061c5470.accept([email protected]/Unknown Source)
at java.util.Optional.ifPresent([email protected]/Optional.java:178)
at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.addEntitiesToWorld([email protected]/StructureTemplate.java:427)
at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.m_230328
([email protected]/StructureTemplate.java:337)
at net.minecraft.world.level.levelgen.structure.pools.SinglePoolElement.m_213695
([email protected]/SinglePoolElement.java:124)
at net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece.m_226509_([email protected]/PoolElementStructurePiece.java:89)
at net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece.m_213694_([email protected]/PoolElementStructurePiece.java:85)
at net.minecraft.world.level.levelgen.structure.StructureStart.m_226850_([email protected]/StructureStart.java:90)
at net.minecraft.world.level.chunk.ChunkGenerator.m_223080_([email protected]/ChunkGenerator.java:320)
at net.minecraft.world.level.chunk.ChunkGenerator$$Lambda$64054/0x0000000806198da0.accept([email protected]/Unknown Source)
at com.google.common.collect.ImmutableList.forEach([email protected]/ImmutableList.java:422)
at net.minecraft.world.level.chunk.ChunkGenerator.m_213609_([email protected]/ChunkGenerator.java:319)
at net.minecraft.world.level.chunk.ChunkStatus.m_279978_([email protected]/ChunkStatus.java:108)
at net.minecraft.world.level.chunk.ChunkStatus$$Lambda$2566/0x0000000800b770f8.m_156322_([email protected]/Unknown Source)
at net.minecraft.world.level.chunk.ChunkStatus$SimpleGenerationTask.m_214024_([email protected]/ChunkStatus.java:309)
at net.minecraft.world.level.chunk.ChunkStatus.m_280308_([email protected]/ChunkStatus.java:252)
at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$27([email protected]/ChunkMap.java:643)
at net.minecraft.server.level.ChunkMap$$Lambda$63903/0x000000080615a590.apply([email protected]/Unknown Source)
at com.mojang.datafixers.util.Either$Left.map([email protected]/Either.java:38)
at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$29([email protected]/ChunkMap.java:634)
at net.minecraft.server.level.ChunkMap$$Lambda$63865/0x0000000806154438.apply([email protected]/Unknown Source)
at java.util.concurrent.CompletableFuture$UniCompose.tryFire([email protected]/CompletableFuture.java:1150)
at java.util.concurrent.CompletableFuture$Completion.run([email protected]/CompletableFuture.java:482)
at net.minecraft.server.level.ChunkTaskPriorityQueueSorter.m_143188_([email protected]/ChunkTaskPriorityQueueSorter.java:62)
at net.minecraft.server.level.ChunkTaskPriorityQueueSorter$$Lambda$63901/0x000000080615a140.run([email protected]/Unknown Source)
at net.minecraft.util.thread.ProcessorMailbox.m_18759_([email protected]/ProcessorMailbox.java:91)
at net.minecraft.util.thread.ProcessorMailbox.m_18747_([email protected]/ProcessorMailbox.java:146)
at net.minecraft.util.thread.ProcessorMailbox.run([email protected]/ProcessorMailbox.java:102)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec([email protected]/ForkJoinTask.java:1395)
at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:373)
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1182)
at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1655)
at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1622)
at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:165)

Locked ownable synchronizers:
- None

Now the full dump in case you want to take a look
https://gist.github.com/Zelioth/db837175e45c530e2e2a9d69967c7cda