We've been running into an issue that causes region halts that happens with the player quit queues, while attempting to fetch a config reference for a world that might've been unloaded at the time of call (they are dynamically loaded/unloaded).
"Region shutdown thread" #28615 [42313] prio=8 os_prio=0 cpu=1274851.89ms elapsed=1279.94s tid=0x00007f32c81bc260 nid=42313 runnable [0x00007f331affd000]
java.lang.Thread.State: RUNNABLE
at java.util.WeakHashMap.matchesKey(java.base@21.0.2/Unknown Source)
at java.util.WeakHashMap.get(java.base@21.0.2/Unknown Source)
at net.coreprotect.config.Config.getConfig(Config.java:265)
at net.coreprotect.listener.player.PlayerQuitListener.queuePlayerQuit(PlayerQuitListener.java:15)
at net.coreprotect.CoreProtect.safeShutdown(CoreProtect.java:172)
at net.coreprotect.CoreProtect.onDisable(CoreProtect.java:134)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:290)
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:223)
- locked <0x00007f3750b8a4b0> (a io.papermc.paper.plugin.manager.PaperPluginInstanceManager)
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:147)
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:92)
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:528)
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.disablePlugins(CraftServer.java:576)
at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:1047)
at net.minecraft.server.dedicated.DedicatedServer.t(DedicatedServer.java:833)
at io.papermc.paper.threadedregions.RegionShutdownThread.run(RegionShutdownThread.java:136)
FWIW this issue only seems to happen on Folia.
We've been running into an issue that causes region halts that happens with the player quit queues, while attempting to fetch a config reference for a world that might've been unloaded at the time of call (they are dynamically loaded/unloaded).
https://github.com/PlayPro/CoreProtect/blob/b1598a022af4898169f767f6cdcf0cd12a7bf7d8/src/main/java/net/coreprotect/config/Config.java#L264-L271