NEZNAMY / TAB-Bridge

Backend plugin to extend features on the proxy
31 stars 7 forks source link

Plugin is not properly shutting down its async tasks when it is being shut down #15

Closed RealTriassic closed 1 year ago

RealTriassic commented 1 year ago

Every time my server reboots, this error gets printed in console right before it completes the shut down sequence.

[14:48:01 ERROR]: Nag author: 'NEZNAMY' of 'TAB-Bridge' about the following: This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies.
[14:48:01 ERROR]: Craft Scheduler Thread - 1279 - TAB-Bridge Stacktrace
[14:48:01 ERROR]:   java.base@17.0.6/jdk.internal.misc.Unsafe.park(Native Method)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.locks.LockSupport.park(LockSupport.java:211)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1864)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3463)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3434)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1898)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2117)
[14:48:01 ERROR]:   net.minecraft.server.level.ChunkProviderServer.a(ChunkProviderServer.java:426)
[14:48:01 ERROR]:   net.minecraft.world.level.World.a(World.java:651)
[14:48:01 ERROR]:   net.minecraft.world.level.IWorldReader.getNoiseBiome(IWorldReader.java:62)
[14:48:01 ERROR]:   org.bukkit.craftbukkit.v1_19_R2.CraftRegionAccessor.getBiome(CraftRegionAccessor.java:214)
[14:48:01 ERROR]:   org.bukkit.craftbukkit.v1_19_R2.block.CraftBlock.getBiome(CraftBlock.java:343)
[14:48:01 ERROR]:   com.extendedclip.papi.expansion.player.PlayerUtil.getBiome(PlayerUtil.java:228)
[14:48:01 ERROR]:   com.extendedclip.papi.expansion.player.PlayerUtil.getCapitalizedBiome(PlayerUtil.java:232)
[14:48:01 ERROR]:   com.extendedclip.papi.expansion.player.PlayerExpansion.onRequest(PlayerExpansion.java:299)
[14:48:01 ERROR]:   PlaceholderAPI-2.11.2.jar//me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119)
[14:48:01 ERROR]:   PlaceholderAPI-2.11.2.jar//me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71)
[14:48:01 ERROR]:   PlaceholderAPI-2.11.2.jar//me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:99)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.bukkit.BukkitPlatform.lambda$createPlaceholder$2(BukkitPlatform.java:196)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.bukkit.BukkitPlatform$$Lambda$10574/0x0000000802f5f8b0.apply(Unknown Source)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.shared.placeholder.PlayerPlaceholder.request(PlayerPlaceholder.java:30)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.shared.placeholder.PlayerPlaceholder.update(PlayerPlaceholder.java:20)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.shared.DataBridge.updatePlaceholders(DataBridge.java:237)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.shared.DataBridge.lambda$startTasks$1(DataBridge.java:25)
[14:48:01 ERROR]:   TABBridge-2.0.10.jar//me.neznamy.tab.bridge.shared.DataBridge$$Lambda$7798/0x000000080245b6b0.run(Unknown Source)
[14:48:01 ERROR]:   org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftTask.run(CraftTask.java:101)
[14:48:01 ERROR]:   org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[14:48:01 ERROR]:   com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[14:48:01 ERROR]:   java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[14:48:01 ERROR]:   java.base@17.0.6/java.lang.Thread.run(Thread.java:833)

That's all, thought you might be interested to know about this error. It doesn't break anything.

NEZNAMY commented 1 year ago

It does though https://github.com/NEZNAMY/TAB-Bridge/blob/main/src/main/java/me/neznamy/tab/bridge/bukkit/BukkitBridge.java#L58

RealTriassic commented 1 year ago

Yeah, really interesting

RealTriassic commented 1 year ago

I think it could be useful to note that it doesn't happen every reboot, I personally reboot my server every 12 hours and it only happens sometimes.

NEZNAMY commented 1 year ago

Plugin is almost not using the bukkit scheduler anymore. Reopen if issue is still present in latest version.