Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix watchdog restarting on short timeout #1344

Merged
merged 1 commit into from Aug 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -145,11 +145,12 @@ index 57a4748a30..28a9e2b96f 100644
+
log.log( Level.SEVERE, "------------------------------" );

+ if ( isLongTimeout )
+ {
if ( restart )
{
RestartCommand.restart();
}
+ if (isLongTimeout) {
break;
+ } // Paper end
}
Expand Down