From b20fb55df37fdd45ba84a7b80274aacb7ae33555 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Wed, 12 Dec 2018 17:41:11 -0800 Subject: [PATCH] Disable watchdog early timeout for CraftServer#reload() invocations (#1718) Fixes GH-1381 --- ...dd-Early-Warning-Feature-to-WatchDog.patch | 28 ++++++++++++++++--- .../Async-Chunk-Loading-and-Generation.patch | 6 ++-- .../Avoid-dimension-id-collisions.patch | 2 +- ...ault-permission-message-configurable.patch | 4 +-- .../Support-Overriding-World-Seeds.patch | 8 +++--- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch index 3bfcb73b82..039fe86303 100644 --- a/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index fad2f8f822..4061073b22 100644 +index 59264969a..8e522e3aa 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import org.bukkit.configuration.file.YamlConfiguration; @@ -36,7 +36,7 @@ index fad2f8f822..4061073b22 100644 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 498a0c4504..1166209840 100644 +index c3efb5e1b..ca72e6ad1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -47,8 +47,28 @@ index 498a0c4504..1166209840 100644 Arrays.fill( recentTps, 20 ); long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop lastTick = start - TICK_TIME; // Paper +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 71d1929c1..93a8f4cdf 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + + @Override + public void reload() { ++ org.spigotmc.WatchdogThread.hasStarted = false; // Paper - Disable watchdog early timeout on reload + reloadCount++; + configuration = YamlConfiguration.loadConfiguration(getConfigFile()); + commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile()); +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + enablePlugins(PluginLoadOrder.STARTUP); + enablePlugins(PluginLoadOrder.POSTWORLD); + getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD)); ++ org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload + } + + @Override diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index eed96c60c5..496c5cbdff 100644 +index eed96c60c..496c5cbdf 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -0,0 +0,0 @@ public class SpigotConfig @@ -61,7 +81,7 @@ index eed96c60c5..496c5cbdff 100644 public static boolean bungee; diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index ed5f46bf6f..9dba9510f5 100644 +index ed5f46bf6..9dba9510f 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -0,0 +0,0 @@ import java.lang.management.MonitorInfo; diff --git a/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch b/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch index 1981aff5bb..0a52171e78 100644 --- a/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch +++ b/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch @@ -43,7 +43,7 @@ reading or writing to the chunk will be safe, so plugins still should not be touching chunks asynchronously! diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b703e0848..73b0c2394 100644 +index c54465a62..aa26a7758 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -458,7 +458,7 @@ index 000000000..8f18c2869 + +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index a08e7ff2e..d86e12042 100644 +index 44d59d253..0bd975b6d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -2295,7 +2295,7 @@ index bab0c0e0f..af68074c1 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2a9ff6d59..5945e1a6d 100644 +index 07f6580fd..c79baa922 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Avoid-dimension-id-collisions.patch b/Spigot-Server-Patches/Avoid-dimension-id-collisions.patch index 7768d14ae8..d61503a5de 100644 --- a/Spigot-Server-Patches/Avoid-dimension-id-collisions.patch +++ b/Spigot-Server-Patches/Avoid-dimension-id-collisions.patch @@ -8,7 +8,7 @@ we would reuse an existing dimension id, if some other dimension was unloaded before. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ef09846e8..c56511abc 100644 +index d43f8ce9a..07f6580fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch index b5397c0faa..6e0e56f4ad 100644 --- a/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index beec4e33c..579726bb5 100644 +index 26e52ace4..7a2fddce9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.util.regex.Pattern; @@ -29,7 +29,7 @@ index beec4e33c..579726bb5 100644 private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 648ac4d18..645953a31 100644 +index c79baa922..352f86967 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Support-Overriding-World-Seeds.patch b/Spigot-Server-Patches/Support-Overriding-World-Seeds.patch index f4f07ab1cb..b191a9bf4e 100644 --- a/Spigot-Server-Patches/Support-Overriding-World-Seeds.patch +++ b/Spigot-Server-Patches/Support-Overriding-World-Seeds.patch @@ -15,7 +15,7 @@ This seed will end up being saved to the world data file, so it is a permanent change in that it won't go back if you remove it from paper.yml diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 4061073b2..b703e0848 100644 +index 8e522e3aa..c54465a62 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.lang.reflect.Modifier; @@ -59,7 +59,7 @@ index 4061073b2..b703e0848 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2105fa50b..1f9e8a082 100644 +index 9b2703fd2..ef49fc258 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -72,7 +72,7 @@ index 2105fa50b..1f9e8a082 100644 if (j == 0) { diff --git a/src/main/java/net/minecraft/server/WorldData.java b/src/main/java/net/minecraft/server/WorldData.java -index b3e1bee92..3ef1a7c2d 100644 +index 33d878378..b9cc0e898 100644 --- a/src/main/java/net/minecraft/server/WorldData.java +++ b/src/main/java/net/minecraft/server/WorldData.java @@ -0,0 +0,0 @@ public class WorldData { @@ -85,7 +85,7 @@ index b3e1bee92..3ef1a7c2d 100644 String s = nbttagcompound.getString("generatorName"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0eab17bd3..ef09846e8 100644 +index 93a8f4cdf..d43f8ce9a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server {