Add description to Error raised by the server hang watchdog. (#4714)

This commit is contained in:
Joseph C. Sible 2018-04-01 03:45:21 -04:00 committed by LexManos
parent db3b2549e2
commit 247d4cb5a8

View file

@ -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();
}