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 a7c455984f..205a6d63ae 100644 --- a/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch @@ -93,16 +93,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.Bukkit; @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread - private static WatchdogThread instance; - private final long timeoutTime; + private long timeoutTime; + private boolean restart; + private final long earlyWarningEvery; // Paper - Timeout time for just printing a dump but not restarting + private final long earlyWarningDelay; // Paper + public static volatile boolean hasStarted; // Paper + private long lastEarlyWarning; // Paper - Keep track of short dump times to avoid spamming console with short dumps - private final boolean restart; private volatile long lastTick; private volatile boolean stopping; + @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread super( "Paper Watchdog Thread" ); this.timeoutTime = timeoutTime; @@ -117,11 +117,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 while ( !stopping ) { - // -- if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable +- if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable + // Paper start + Logger log = Bukkit.getServer().getLogger(); + long currentTime = monotonicMillis(); -+ if ( lastTick != 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) ++ if ( lastTick != 0 && timeoutTime > 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) { - Logger log = Bukkit.getServer().getLogger(); + boolean isLongTimeout = currentTime > lastTick + timeoutTime; diff --git a/Spigot-Server-Patches/Improved-Watchdog-Support.patch b/Spigot-Server-Patches/Improved-Watchdog-Support.patch index a9fc56c884..e298e3a6f2 100644 --- a/Spigot-Server-Patches/Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/Improved-Watchdog-Support.patch @@ -504,8 +504,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public static final boolean DISABLE_WATCHDOG = Boolean.getBoolean("disable.watchdog"); // Paper private static WatchdogThread instance; - private final long timeoutTime; - private final long earlyWarningEvery; // Paper - Timeout time for just printing a dump but not restarting + private long timeoutTime; + private boolean restart; @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread { if ( instance == null ) @@ -513,14 +513,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (timeoutTime <= 0) timeoutTime = 300; // Paper instance = new WatchdogThread( timeoutTime * 1000L, restart ); instance.start(); - } + } else @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread // Paper start Logger log = Bukkit.getServer().getLogger(); long currentTime = monotonicMillis(); -- if ( lastTick != 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) +- if ( lastTick != 0 && timeoutTime > 0 && currentTime > lastTick + earlyWarningEvery && !Boolean.getBoolean("disable.watchdog") ) + MinecraftServer server = MinecraftServer.getServer(); -+ if (lastTick != 0 && hasStarted && (!server.isRunning() || (currentTime > lastTick + earlyWarningEvery && !DISABLE_WATCHDOG) )) ++ if (lastTick != 0 && timeoutTime > 0 && hasStarted && (!server.isRunning() || (currentTime > lastTick + earlyWarningEvery && !DISABLE_WATCHDOG) )) { - boolean isLongTimeout = currentTime > lastTick + timeoutTime; + boolean isLongTimeout = currentTime > lastTick + timeoutTime || (!server.isRunning() && !server.hasStopped() && currentTime > lastTick + 1000); diff --git a/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch b/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch index 1a864e36f1..f59f1d69b9 100644 --- a/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch +++ b/Spigot-Server-Patches/System-property-for-disabling-watchdoge.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 while ( !stopping ) { // -- if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime ) -+ if ( lastTick != 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable +- if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime ) ++ if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable { Logger log = Bukkit.getServer().getLogger(); log.log( Level.SEVERE, "------------------------------" ); diff --git a/work/Bukkit b/work/Bukkit index 64c36cce23..bf6176594c 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 64c36cce230d53551d364159757d108118b87dbe +Subproject commit bf6176594c2809778e59fafb3eb1aabcbde4093f diff --git a/work/Spigot b/work/Spigot index a56d446a8d..5fc0fb4e4c 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit a56d446a8d1972666d063ceb70e5c18f72347a9c +Subproject commit 5fc0fb4e4cf682f5992f1e5f64ae9be5c0a3baf1