mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 01:10:37 +01:00
29a01de126
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9a793cce Remove no longer applicable caveats to setPlayerListName 7137829e SPIGOT-4496: Undeprecate MapView.getId and make int de33ade0 Remove some draft API designations a35fa838 SPIGOT-4472: Add Consumer scheduler methods CraftBukkit Changes:8cd538e6
SPIGOT-4498: Crash on startupb4ee04ba
SPIGOT-4496: Undeprecate MapView.getId and make intec937d0e
SPIGOT-4472: Add Consumer scheduler methods Spigot Changes: a1f2566f Use monotonic time for watchdog bc4adcbf SPIGOT-4498: Crash on startup bb387e6c Rebuild patches
63 lines
3.1 KiB
Diff
63 lines
3.1 KiB
Diff
From f5086788419d64e74ca4647a8e34d439837a6f65 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
|
|
index 3f43d9eeab..5f228373e3 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
@@ -85,8 +85,8 @@ public class CraftScheduler implements BukkitScheduler {
|
|
private volatile CraftTask currentTask = null;
|
|
private volatile int currentTick = -1;
|
|
private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
|
|
- private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}};
|
|
- private CraftAsyncDebugger debugTail = debugHead;
|
|
+ //private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; // Paper
|
|
+ //private CraftAsyncDebugger debugTail = debugHead; // Paper
|
|
private static final int RECENT_TICKS;
|
|
|
|
static {
|
|
@@ -411,7 +411,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
}
|
|
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)
|
|
@@ -428,7 +428,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
pending.addAll(temp);
|
|
temp.clear();
|
|
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming();
|
|
- debugHead = debugHead.getNextHead(currentTick);
|
|
+ //debugHead = debugHead.getNextHead(currentTick); // Paper
|
|
}
|
|
|
|
private void addTask(final CraftTask task) {
|
|
@@ -488,10 +488,15 @@ public class CraftScheduler implements BukkitScheduler {
|
|
|
|
@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
|
|
--
|
|
2.19.1
|
|
|