9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-31 12:56:29 +00:00
Files
Leaf/leaf-server/paper-patches/features/0054-Dump-pwt-thread.patch
2025-10-15 20:21:00 -04:00

30 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: hayanesuru <hayanesuru@outlook.jp>
Date: Sat, 7 Jun 2025 20:33:16 +0900
Subject: [PATCH] Dump pwt thread
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 79eae898539f71a73525ed29d8a752f65f5f67fa..29b5b2b0bc25a3e65696bbfc944b08d465f0561e 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -124,6 +124,18 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
WatchdogThread.dumpThread(ManagementFactory.getThreadMXBean().getThreadInfo(MinecraftServer.getServer().serverThread.threadId(), Integer.MAX_VALUE), logger);
logger.log(Level.SEVERE, "------------------------------");
+ // Leaf start - dump pwt thread
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled) {
+ logger.log(Level.SEVERE, "Parallel world ticking thread dump");
+ for (Thread thread : org.apache.commons.lang3.ThreadUtils.getAllThreads()) {
+ if (thread instanceof ServerLevelTickThread tickThread) {
+ WatchdogThread.dumpThread(ManagementFactory.getThreadMXBean().getThreadInfo(tickThread.threadId(), Integer.MAX_VALUE), logger);
+ }
+ }
+ logger.log(Level.SEVERE, "------------------------------");
+ }
+ // Leaf end - dump pwt thread
+
// Paper start - Only print full dump on long timeouts
if (isLongTimeout) {
logger.log(Level.SEVERE, "Entire Thread Dump:");