Fix watchdog termination hanging indefinitely

This commit is contained in:
Ivan Pekov 2020-09-22 21:25:46 +03:00
parent 56cfcf9e99
commit 6d289f2412
No known key found for this signature in database
GPG Key ID: BC975C392D9CA3A3
2 changed files with 23 additions and 0 deletions

View File

@ -56,6 +56,7 @@ # Patches
| server | Fix recipe crash | Ivan Pekov | |
| server | Fix the dead lagging the server | William Blake Galbreath | |
| server | Fix villager dupe | Ivan Pekov | |
| server | Fix watchdog termination hanging indefinitely | Ivan Pekov | |
| server | Giants AI settings | William Blake Galbreath | |
| server | Global Eula file | tr7zw | |
| server | Heavily optimize furnance fuel and recipe lookups | tr7zw | |

View File

@ -0,0 +1,22 @@
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 8e4cdad1b76c24f4e459077c5a2b4b08e0a7134f..6f0c4f5c42ca687bae0efa131087a393b8f06685 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.asyncExecutor.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