2020-01-22 03:02:07 +01:00
|
|
|
From f2851935c9285c2c9454123b166bcdb733cc50a2 Mon Sep 17 00:00:00 2001
|
2017-02-05 06:13:28 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sun, 5 Feb 2017 00:04:04 -0500
|
|
|
|
Subject: [PATCH] Remove CraftScheduler Async Task Debugger
|
|
|
|
|
|
|
|
I have not once ever seen this system help debug a crash.
|
|
|
|
One report of a suspected memory leak with the system.
|
|
|
|
|
|
|
|
This adds additional overhead to asynchronous task dispatching
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
2020-01-22 03:02:07 +01:00
|
|
|
index 552daf437..e102be583 100644
|
2017-02-05 06:13:28 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
2019-05-06 04:58:04 +02:00
|
|
|
@@ -414,7 +414,7 @@ public class CraftScheduler implements BukkitScheduler {
|
2017-02-05 06:13:28 +01:00
|
|
|
}
|
|
|
|
parsePending();
|
|
|
|
} else {
|
|
|
|
- debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass()));
|
|
|
|
+ //debugTail = debugTail.setNext(new CraftAsyncDebugger(currentTick + RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
|
|
|
executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper
|
|
|
|
// We don't need to parse pending
|
|
|
|
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
2019-05-06 04:58:04 +02:00
|
|
|
@@ -431,7 +431,7 @@ public class CraftScheduler implements BukkitScheduler {
|
2017-02-05 06:13:28 +01:00
|
|
|
pending.addAll(temp);
|
|
|
|
temp.clear();
|
|
|
|
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming();
|
|
|
|
- debugHead = debugHead.getNextHead(currentTick);
|
|
|
|
+ //debugHead = debugHead.getNextHead(currentTick); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
private void addTask(final CraftTask task) {
|
2019-05-06 04:58:04 +02:00
|
|
|
@@ -491,10 +491,15 @@ public class CraftScheduler implements BukkitScheduler {
|
2017-02-05 06:13:28 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
+ // Paper start
|
|
|
|
+ return "";
|
|
|
|
+ /*
|
|
|
|
int debugTick = currentTick;
|
|
|
|
StringBuilder string = new StringBuilder("Recent tasks from ").append(debugTick - RECENT_TICKS).append('-').append(debugTick).append('{');
|
|
|
|
debugHead.debugTo(string);
|
|
|
|
return string.append('}').toString();
|
|
|
|
+ */
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
--
|
2020-01-22 03:02:07 +01:00
|
|
|
2.25.0.windows.1
|
2017-02-05 06:13:28 +01:00
|
|
|
|