2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
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
2024-12-03 15:47:48 +01:00
index 152c816efbd633210ff308ef56f5d0cda6edb1b5..22a5eff6c82df46e528c980afa33be78536b1b93 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
2024-10-27 18:11:15 +01:00
@@ -432,7 +432,7 @@ public class CraftScheduler implements BukkitScheduler {
2021-06-11 14:02:28 +02:00
}
2021-06-12 11:01:04 +02:00
this.parsePending();
2021-06-11 14:02:28 +02:00
} else {
2024-10-22 22:38:26 +02:00
- this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass()));
+ // this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
2023-06-13 01:51:45 +02:00
this.executor.execute(new com.destroystokyo.paper.ServerSchedulerReportingWrapper(task)); // Paper
2021-06-11 14:02:28 +02:00
// 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)
2024-10-27 18:11:15 +01:00
@@ -447,7 +447,7 @@ public class CraftScheduler implements BukkitScheduler {
}
2021-06-12 11:01:04 +02:00
this.pending.addAll(temp);
2021-06-11 14:02:28 +02:00
temp.clear();
2024-10-22 22:38:26 +02:00
- this.debugHead = this.debugHead.getNextHead(this.currentTick);
+ //this.debugHead = this.debugHead.getNextHead(this.currentTick); // Paper
2021-06-11 14:02:28 +02:00
}
private void addTask(final CraftTask task) {
2024-12-03 15:47:48 +01:00
@@ -505,10 +505,15 @@ public class CraftScheduler implements BukkitScheduler {
2021-06-11 14:02:28 +02:00
@Override
public String toString() {
+ // Paper start
+ return "";
+ /*
2021-06-12 11:01:04 +02:00
int debugTick = this.currentTick;
StringBuilder string = new StringBuilder("Recent tasks from ").append(debugTick - CraftScheduler.RECENT_TICKS).append('-').append(debugTick).append('{');
this.debugHead.debugTo(string);
2021-06-11 14:02:28 +02:00
return string.append('}').toString();
+ */
+ // Paper end
}
@Deprecated