From 0106485ccbe83e8db8ef4495c9440cf287b3e7c7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 24 Apr 2020 00:27:28 -0400 Subject: [PATCH] Improvements to watchdog changes catch a thread death, fix invalid watchdog timeouts <= 0 seconds will now change to 5 minutes. --- ...Crash-support-and-Improve-Async-Shut.patch | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/0468-Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch b/Spigot-Server-Patches/0468-Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch index 982995da3..5343778fd 100644 --- a/Spigot-Server-Patches/0468-Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch +++ b/Spigot-Server-Patches/0468-Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch @@ -1,4 +1,4 @@ -From e8380a57b97e6c5ebbc79be3181abeeb462a3b13 Mon Sep 17 00:00:00 2001 +From 6a79fcb39fedf8d5f398026e6da8c616d34470f4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 12 Apr 2020 15:50:48 -0400 Subject: [PATCH] Forced Watchdog Crash support and Improve Async Shutdown @@ -60,6 +60,18 @@ index 1ef7890da5..e62ca0543f 100644 } @Override +diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +index cfe43e882e..2632c7c3ec 100644 +--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java ++++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +@@ -135,6 +135,7 @@ public abstract class IAsyncTaskHandler implements Mailbox 0 && new File( split[0] ).isFile() ) diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 5bdcdcf9e8..963bd001f4 100644 +index 5bdcdcf9e8..fe4b8caf28 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -67,12 +67,13 @@ public class WatchdogThread extends Thread +@@ -41,6 +41,7 @@ public class WatchdogThread extends Thread + { + if ( instance == null ) + { ++ if (timeoutTime <= 0) timeoutTime = 300; // Paper + instance = new WatchdogThread( timeoutTime * 1000L, restart ); + instance.start(); + } +@@ -67,12 +68,13 @@ public class WatchdogThread extends Thread // Paper start Logger log = Bukkit.getServer().getLogger(); long currentTime = monotonicMillis(); @@ -288,7 +308,7 @@ index 5bdcdcf9e8..963bd001f4 100644 lastEarlyWarning = currentTime; if (isLongTimeout) { // Paper end -@@ -114,7 +115,7 @@ public class WatchdogThread extends Thread +@@ -114,7 +116,7 @@ public class WatchdogThread extends Thread log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper ChunkTaskManager.dumpAllChunkLoadInfo(); // Paper @@ -297,7 +317,7 @@ index 5bdcdcf9e8..963bd001f4 100644 log.log( Level.SEVERE, "------------------------------" ); // // Paper start - Only print full dump on long timeouts -@@ -135,9 +136,24 @@ public class WatchdogThread extends Thread +@@ -135,9 +137,24 @@ public class WatchdogThread extends Thread if ( isLongTimeout ) {