Don't grab the threads stacktrace when dumping same thread
For some reason, this doesn't always seem to capture all states of shutdown, either the logger is just being fun, or, potentially, the thread is already marked as dead when we're getting called so the trace is not generated through the method on Thread
This commit is contained in:
@@ -23,6 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ Bukkit.getLogger().warning("\tat " + traceElement);
|
+ Bukkit.getLogger().warning("\tat " + traceElement);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ public static void dumpTraceForThread(String reason) {
|
||||||
|
+ new Throwable(reason).printStackTrace();
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
@@ -48,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
if (hasStopped) return;
|
if (hasStopped) return;
|
||||||
hasStopped = true;
|
hasStopped = true;
|
||||||
}
|
}
|
||||||
+ if (!hasLoggedStop && isDebugging()) TraceUtil.dumpTraceForThread(this.getThread(), "Server stopped"); // Paper
|
+ if (!hasLoggedStop && isDebugging()) TraceUtil.dumpTraceForThread("Server stopped"); // Paper
|
||||||
// Paper start - kill main thread, and kill it hard
|
// Paper start - kill main thread, and kill it hard
|
||||||
shutdownThread = Thread.currentThread();
|
shutdownThread = Thread.currentThread();
|
||||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||||
@@ -57,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.isRunning = false;
|
this.isRunning = false;
|
||||||
this.isRestarting = isRestarting;
|
this.isRestarting = isRestarting;
|
||||||
+ this.hasLoggedStop = true; // Paper
|
+ this.hasLoggedStop = true; // Paper
|
||||||
+ if (isDebugging()) TraceUtil.dumpTraceForThread(this.getThread(), "Server stopped"); // Paper
|
+ if (isDebugging()) TraceUtil.dumpTraceForThread("Server stopped"); // Paper
|
||||||
if (flag) {
|
if (flag) {
|
||||||
try {
|
try {
|
||||||
this.serverThread.join();
|
this.serverThread.join();
|
||||||
|
|||||||
Reference in New Issue
Block a user