From 3f277e8af591c30d340c648562d2ecdabc948337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?= Date: Sat, 18 Apr 2020 18:11:28 +0800 Subject: [PATCH] Log exceptions for async chunk load failures --- ...ptions-for-async-chunk-load-failures.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 patches/server/0022-Tuinity-Log-exceptions-for-async-chunk-load-failures.patch diff --git a/patches/server/0022-Tuinity-Log-exceptions-for-async-chunk-load-failures.patch b/patches/server/0022-Tuinity-Log-exceptions-for-async-chunk-load-failures.patch new file mode 100644 index 000000000..f2ad16344 --- /dev/null +++ b/patches/server/0022-Tuinity-Log-exceptions-for-async-chunk-load-failures.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E3=84=97=E3=84=A0=CB=8B=20=E3=84=91=E3=84=A7=CB=8A?= + +Date: Sat, 18 Apr 2020 18:10:56 +0800 +Subject: [PATCH] Tuinity Log exceptions for async chunk load failures + + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index bf6bf7d8c6c7e2d8572a33ed16767d8ba34156e7..1119dd5048cbb8cdd5727e18b154ed15a9a06b63 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -326,7 +326,10 @@ public class ChunkProviderServer extends IChunkProvider { + // either right -> failure + + if (throwable != null) { +- throw new RuntimeException(throwable); ++ // Tuinity start - thank you once again completablefuture ++ MinecraftServer.LOGGER.fatal("Failed to asynchronously load chunk " + chunkPos, throwable); ++ return; ++ // Tuinity end - thank you once again completablefuture + } + + this.removeTicketAtLevel(TicketType.ASYNC_LOAD, chunkPos, ticketLevel, identifier); +@@ -336,12 +339,19 @@ public class ChunkProviderServer extends IChunkProvider { + + if (failure.isPresent()) { + // failure +- throw new IllegalStateException("Chunk failed to load: " + failure.get().toString()); ++ // Tuinity start - thank you once again completablefuture ++ MinecraftServer.LOGGER.fatal("Failed to asynchronously load chunk " + chunkPos, new IllegalStateException("Chunk failed to load: " + failure.get().toString())); ++ return; ++ // Tuinity end - thank you once again completablefuture + } + + onComplete.accept(either.left().get()); + +- }, this.serverThreadQueue); ++ }, this.serverThreadQueue).exceptionally((throwable) -> { // Tuinity start - thank you once again completablefuture ++ MinecraftServer.LOGGER.fatal("Failed to asynchronously load chunk " + chunkPos); ++ return null; ++ }); ++ // Tuinity end - thank you once again completablefuture + } + + public void addTicketAtLevel(TicketType ticketType, ChunkCoordIntPair chunkPos, int ticketLevel, T identifier) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index f56131e3a593f9c1344be07fe478364b344e63dd..0f3199ba4a228cc60db3abfa4ac926b92cbb4b4b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -2472,6 +2472,13 @@ public class CraftWorld implements World { + this.world.doIfNotEntityTicking(() -> ret.complete(chunk == null ? null : chunk.bukkitChunk)); + }); + ++ // Tuinity start - thank you once again completablefuture ++ ret.exceptionally((throwable) -> { ++ net.minecraft.server.MinecraftServer.LOGGER.fatal("Failed to asynchronously load chunk (" + x + "," + z + ")", throwable); ++ return null; ++ }); ++ // Tuinity end - thank you once again completablefuture ++ + return ret; + } + // Paper end