mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 06:48:23 +01:00
Improvements to watchdog changes
catch a thread death, fix invalid watchdog timeouts <= 0 seconds will now change to 5 minutes.
This commit is contained in:
parent
d0f606ec78
commit
71ed03c3ca
1 changed files with 21 additions and 1 deletions
|
@ -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
|
||||
@@ -0,0 +0,0 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
|
||||
try {
|
||||
r0.run();
|
||||
} catch (Exception exception) {
|
||||
+ if (exception.getCause() instanceof ThreadDeath) throw exception; // Paper
|
||||
IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bi(), exception);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 7bfadb35d2..1086d1caac 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
|
@ -268,9 +280,17 @@ index aefea3a9a8..123de5ac90 100644
|
|||
String[] split = restartScript.split( " " );
|
||||
if ( split.length > 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
|
||||
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||
{
|
||||
if ( instance == null )
|
||||
{
|
||||
+ if (timeoutTime <= 0) timeoutTime = 300; // Paper
|
||||
instance = new WatchdogThread( timeoutTime * 1000L, restart );
|
||||
instance.start();
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||
// Paper start
|
||||
Logger log = Bukkit.getServer().getLogger();
|
||||
|
|
Loading…
Reference in a new issue