From 5553e6b3e3d7fa0aebcf2d675ca97571a2356417 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 11 Apr 2020 21:50:32 -0400 Subject: [PATCH] Disable Sync Events firing Async errors during shutdown This is how it use to behave on Paper, and this is totally destroying the ability to try to shut the server down gracefully during the shutdown process as events firing on the watchdog thread are throwing errors. This isn't an issue on Spigot This has caused me so many rollbacks on watchdog already :( --- ...nts-firing-Async-errors-during-shutd.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Spigot-API-Patches/0195-Disable-Sync-Events-firing-Async-errors-during-shutd.patch diff --git a/Spigot-API-Patches/0195-Disable-Sync-Events-firing-Async-errors-during-shutd.patch b/Spigot-API-Patches/0195-Disable-Sync-Events-firing-Async-errors-during-shutd.patch new file mode 100644 index 000000000..b3c69fcd8 --- /dev/null +++ b/Spigot-API-Patches/0195-Disable-Sync-Events-firing-Async-errors-during-shutd.patch @@ -0,0 +1,28 @@ +From 1e9550b8715340fa26b9de6bf6c1b0fee593b885 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 11 Apr 2020 21:38:59 -0400 +Subject: [PATCH] Disable Sync Events firing Async errors during shutdown + +This is how it use to behave on Paper, and this is totally destroying +the ability to try to shut the server down gracefully during the +shutdown process as events firing on the watchdog thread are throwing +errors. + +This isn't an issue on Spigot + +diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java +index 8355f9f0e..4931bc86d 100644 +--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java ++++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java +@@ -591,7 +591,7 @@ public final class SimplePluginManager implements PluginManager { + // Paper - replace callEvent by merging to below method + if (event.isAsynchronous() && server.isPrimaryThread()) { + throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously."); +- } else if (!event.isAsynchronous() && !server.isPrimaryThread()) { ++ } else if (!event.isAsynchronous() && !server.isPrimaryThread() && !server.isStopping() ) { + throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously."); + } + +-- +2.25.1 +