Yatopia/patches/server/0052-Fix-watchdog-termination-hanging-indefinitely.patch
Ivan Pekov c4a1166224
Add more permanent getLastTick time API
Also fix bad plugins that touch NMS not working
2020-09-27 19:05:16 +03:00

23 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Tue, 22 Sep 2020 21:18:24 +0300
Subject: [PATCH] Fix watchdog termination hanging indefinitely
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0540414af5e2462ac33710b94efde0d78df1eedf..534ffa0df296d02fbc69102b7d38edb0bdb350cc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -820,6 +820,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
MCUtil.asyncExecutor.shutdown(); // Paper
try { MCUtil.asyncExecutor.awaitTermination(30, java.util.concurrent.TimeUnit.SECONDS); // Paper
} catch (java.lang.InterruptedException ignored) {} // Paper
+ // Yatopia start - fix watchdog hanging indefinitely
+ MCUtil.cleanerExecutor.shutdown();
+ try { MCUtil.cleanerExecutor.awaitTermination(30, java.util.concurrent.TimeUnit.SECONDS);
+ } catch (InterruptedException ignored) {}
+ // Yatopia end
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json");
this.getUserCache().b(false); // Paper