SBPrime / AsyncWorldEdit

Async WorldEdit - Edit millions of blocks without lag!
Other
197 stars 80 forks source link

Paper freezes when editing blocks that ware not loaded. #393

Open Zoro-6191 opened 3 years ago

Zoro-6191 commented 3 years ago

In paper 1.16.5, using latest AWE update of that time, the same schematic pasted without any hitches, in same 8gb ram quadcore VPS. Now in 1.17, it's crashing after 30seconds or so. Processes blocks perfectly, says ready to paste, after //paste it pastes few million blocks and then comes massive amount of errors, eventually crashing server.

image Pasted this much last time I ran the command.

image

Here's complete log of that session: 2021-06-25-1.log.gz

I'm a bit confused if it's world edit's fault or AWE tho, lmk

SBPrime commented 3 years ago

Unfortunately I do not support paper (it has its quirks regarding chunk events). From the attached log I can see that AWE is waiting for a chunk load:

[14:11:08] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/jdk.internal.misc.Unsafe.park(Native Method)
[14:11:08] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.locks.LockSupport.park(LockSupport.java:211)
[14:11:08] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1860)
[14:11:08] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3137)
[14:11:08] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1894)
[14:11:08] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2113)
[14:11:08] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:478)
[14:11:08] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.world.level.Level.getChunk(Level.java:418)
[14:11:08] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.world.level.Level.getChunk(Level.java:359)
[14:11:08] [Paper Watchdog Thread/ERROR]:       com.sk89q.worldedit.bukkit.adapter.impl.Spigot_v1_17_R1.getBlock(Spigot_v1_17_R1.java:349)
[14:11:08] [Paper Watchdog Thread/ERROR]:       com.sk89q.worldedit.bukkit.BukkitWorld.getFullBlock(BukkitWorld.java:500)
[14:11:08] [Paper Watchdog Thread/ERROR]:       org.primesoft.asyncworldedit.worldedit.world.AsyncWorld.lambda$getFullBlockDispatcher$19(AsyncWorld.java:791)

This should not cause any problems, the server thread is waiting on managedBlocks (whatever that is):

[14:10:16] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
[14:10:16] [Paper Watchdog Thread/ERROR]:   PID: 23 | Suspended: false | Native: false | State: TIMED_WAITING
[14:10:16] [Paper Watchdog Thread/ERROR]:   Stack:
[14:10:16] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/jdk.internal.misc.Unsafe.park(Native Method)
[14:10:16] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.util.thread.BlockableEventLoop.waitForTasks(BlockableEventLoop.java:144)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:133)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:516)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ServerChunkCache.lambda$getChunk$9(ServerChunkCache.java:477)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ChunkProviderServer$$Lambda$6625/0x00000008020862e8.get(Unknown Source)
[14:10:16] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.doRunTask(ServerChunkCache.java:1018)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.pollTask(ServerChunkCache.java:1065)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.level.ServerChunkCache.pollTask(ServerChunkCache.java:662)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1312)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1273)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1184)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320)
[14:10:16] [Paper Watchdog Thread/ERROR]:       app//net.minecraft.server.MinecraftServer$$Lambda$3662/0x00000008013a7b70.run(Unknown Source)
[14:10:16] [Paper Watchdog Thread/ERROR]:       java.base@16.0.1/java.lang.Thread.run(Thread.java:831)

My gut feeling tells me that it might be your server running out of memory. Please try answering the bellow questions:

  1. Ware the target chunks already generated
  2. Ware the target chunks loader in memory
  3. How large was the paste (X,Z or chunk count)
  4. How many blocks did you load into clipboard
  5. How many blocks ware pasted by AWE?

Bonus: I could say a bit more if you provided link to your version of paper.

Zoro-6191 commented 3 years ago

Hi First of all thanks for the attention

Schematic was 56million total blocks in size, and you were correct about the chunk problem, although it wasn't a problem of lack of memory

I used Chunky Plugin to preload 1000x1000 blocks and that solved my problem, took around 1.5 hours with just //paste without any air args, should be much quicker with the args

My first post was of paper 1.17 #42, and I used paper #53 after which problem was solved

SBPrime commented 3 years ago

Thx, for update, I'll change the description of the issue to reflect the actual problem.