Paper/patches/server/0878-Fix-deadlock-on-watchdog-crash.patch
Nassim Jahnke 719daa8bbf
Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
4ed5af5e SPIGOT-6956: Reduce differences caused by setKeepSpawnInMemory(false)
21fe78aa SPIGOT-6957: Bad default value for WorldCreator#generatorSettings
ce373be6 PR-1022: Fix get HighestBlockAt in chunk snapshot
2022-03-04 09:33:13 +01:00

22 Zeilen
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Fri, 4 Mar 2022 00:12:49 -0700
Subject: [PATCH] Fix deadlock on watchdog crash
The watchdog thread sets MinecraftServer#forceTicks to true which will
cause waitUntilNextTick to hang when the task queue is drained.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 17e87875a95495940899b862eabf98b3d6a365da..07c382f30ed3736ed15b5b71f48dc4a1de958242 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1012,7 +1012,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}, false);
}
- this.waitUntilNextTick();
+ this.managedBlock(() -> !this.canSleepForTickNoOversleep() || this.getPendingTasksCount() == 0); // Paper - based on waitUntilNextTick
}
this.saveAllChunks(false, true, false);