From 247d4cb5a8ce18a8c62050aa4e475d4e0e391450 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Sun, 1 Apr 2018 03:45:21 -0400 Subject: [PATCH] Add description to Error raised by the server hang watchdog. (#4714) --- .../server/dedicated/ServerHangWatchdog.java.patch | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch b/patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch index 286148004..7d5812f0d 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java.patch @@ -8,7 +8,7 @@ public ServerHangWatchdog(DedicatedServer p_i46310_1_) { -@@ -37,7 +38,7 @@ +@@ -37,14 +38,14 @@ long j = MinecraftServer.func_130071_aq(); long k = j - i; @@ -17,6 +17,14 @@ { field_180251_a.fatal("A single server tick took {} seconds (should be max {})", String.format("%.2f", (float)k / 1000.0F), String.format("%.2f", 0.05F)); field_180251_a.fatal("Considering it to be crashed, server will forcibly shutdown."); + ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean(); + ThreadInfo[] athreadinfo = threadmxbean.dumpAllThreads(true, true); + StringBuilder stringbuilder = new StringBuilder(); +- Error error = new Error(); ++ Error error = new Error(String.format("ServerHangWatchdog detected that a single server tick took %.2f seconds (should be max 0.05)", k / 1000F)); // Forge: don't just make a crash report with a seemingly-inexplicable Error + + for (ThreadInfo threadinfo : athreadinfo) + { @@ -75,6 +76,8 @@ this.func_180248_a(); }