mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
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:
parent
bbb0f52210
commit
1487ee284e
1 changed files with 6 additions and 2 deletions
|
@ -23,6 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ 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
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -48,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
if (hasStopped) return;
|
||||
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
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
|
@ -57,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.isRunning = false;
|
||||
this.isRestarting = isRestarting;
|
||||
+ this.hasLoggedStop = true; // Paper
|
||||
+ if (isDebugging()) TraceUtil.dumpTraceForThread(this.getThread(), "Server stopped"); // Paper
|
||||
+ if (isDebugging()) TraceUtil.dumpTraceForThread("Server stopped"); // Paper
|
||||
if (flag) {
|
||||
try {
|
||||
this.serverThread.join();
|
||||
|
|
Loading…
Add table
Reference in a new issue