Fix watchdog restarting on short timeout (#1344)

This commit is contained in:
searchndstroy 2018-08-17 09:09:08 -07:00 committed by Daniel Ennis
parent 4f4a4fc100
commit 3f883badab

View file

@ -1,4 +1,4 @@
From 572418116aca425b6283f25eb1aaefafac1381fd Mon Sep 17 00:00:00 2001
From 5ed114bb47c66db7798442d43bc8914ccea4cd5d Mon Sep 17 00:00:00 2001
From: miclebrick <miclebrick@outlook.com>
Date: Wed, 8 Aug 2018 15:30:52 -0400
Subject: [PATCH] Add Early Warning Feature to WatchDog
@ -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 a5ff014e33..332e90f86b 100644
index a5ff014e3..332e90f86 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -23,6 +23,8 @@ import org.bukkit.configuration.InvalidConfigurationException;
@ -37,7 +37,7 @@ index a5ff014e33..332e90f86b 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 0399a48e19..e0546e3dd2 100644
index 0399a48e1..e0546e3dd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -622,6 +622,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
@ -49,7 +49,7 @@ index 0399a48e19..e0546e3dd2 100644
long start = System.nanoTime(), lastTick = start - TICK_TIME, catchupTime = 0, curTime, wait, tickSection = start; // Paper - Further improve server tick loop
while (this.isRunning) {
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 4f9fd4bc60..2cdd9aaf81 100644
index 4f9fd4bc6..2cdd9aaf8 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -223,7 +223,7 @@ public class SpigotConfig
@ -62,7 +62,7 @@ index 4f9fd4bc60..2cdd9aaf81 100644
public static boolean bungee;
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 57a4748a30..28a9e2b96f 100644
index 57a4748a3..93dc69835 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -5,6 +5,7 @@ import java.lang.management.MonitorInfo;
@ -114,7 +114,7 @@ index 57a4748a30..28a9e2b96f 100644
log.log( Level.SEVERE, "The server has stopped responding!" );
log.log( Level.SEVERE, "Please report this to https://github.com/PaperMC/Paper/issues" );
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
@@ -79,29 +96,45 @@ public class WatchdogThread extends Thread
@@ -79,29 +96,46 @@ public class WatchdogThread extends Thread
}
}
// Paper end
@ -145,11 +145,12 @@ index 57a4748a30..28a9e2b96f 100644
+
log.log( Level.SEVERE, "------------------------------" );
+ if ( isLongTimeout )
+ {
if ( restart )
{
RestartCommand.restart();
}
+ if (isLongTimeout) {
break;
+ } // Paper end
}