From 58c0bbdd114fd1e0c2f4d464754bf5b091c8b698 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 6 May 2020 20:18:31 -0400 Subject: [PATCH] Force Plugins that use delayed tasks for init back in their place Will now run those tasks just before we print "Done" so that startup time is appropriately accounted for a plugin, as well as will no longer trip the watchdog on startup. Any plugin that tries to bypass this is just going to then trip watchdog on Spigot too, so don't you dare. Stop trying to cheat the delay your plugin added to startup time. This isn't a behavior change because the first thing the tick does.... was run these tasks.... So it's just moving it slightly a few lines to be before a watchdog tick and to account for it in "Done" time. Fixes #3294 --- ...Shut.patch => Improved-Watchdog-Support.patch} | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) rename Spigot-Server-Patches/{Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch => Improved-Watchdog-Support.patch} (95%) diff --git a/Spigot-Server-Patches/Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch b/Spigot-Server-Patches/Improved-Watchdog-Support.patch similarity index 95% rename from Spigot-Server-Patches/Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch rename to Spigot-Server-Patches/Improved-Watchdog-Support.patch index 278c6aa9e0..6a76c1ca7f 100644 --- a/Spigot-Server-Patches/Forced-Watchdog-Crash-support-and-Improve-Async-Shut.patch +++ b/Spigot-Server-Patches/Improved-Watchdog-Support.patch @@ -1,7 +1,9 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 12 Apr 2020 15:50:48 -0400 -Subject: [PATCH] Forced Watchdog Crash support and Improve Async Shutdown +Subject: [PATCH] Improved Watchdog Support + +Forced Watchdog Crash support and Improve Async Shutdown If the request to shut down the server is received while we are in a watchdog hang, immediately treat it as a crash and begin the shutdown @@ -35,6 +37,9 @@ We have to ensure Thread Death propagates correctly though to stop main complete This is to ensure that if main isn't truely stuck, it's not manipulating state we are trying to save. +This also moves all plugins who register "delayed init" tasks to occur just before "Done" so they +are properly accounted for and wont trip watchdog on init. + diff --git a/src/main/java/net/minecraft/server/CrashReport.java b/src/main/java/net/minecraft/server/CrashReport.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/CrashReport.java @@ -93,6 +98,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end // Spigot start public static final int TPS = 20; +@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant