LuckPerms

LuckPerms

41.4k Downloads

Resource Leak (ForkJoinPool)

Ingrim4 opened this issue ยท 4 comments

commented

Description

LuckPerms is using a ForkJoinPool in their BukkitSchedulerAdapter (and probably also in other adapters + maybe CaffeineFactory) and doesn't shut it down. This behavior can be observed trough an attached debugger (e.g. eclipse/intellij-debugger) and this has only been observe if the server is running LuckPerms.

Screenshot of Debugger

Reproduction Steps

  • reload plugin/server

Expected Behaviour

  • ForkJoinPools should be shutdown at the end of the plugins life cycle

Server Details

3368-Spigot-8965a50-2a2caa7 (MC: 1.18.1)

LuckPerms Version

v5.3.86

Logs and Configs

  • default config

Extra Details

No response

commented

Does this only occur with a server-wide /reload? This command unfortunately will cause sporadic problems with a lot of things, but if LuckPerms' own reload command causes this as well, it would be good to know. Also going to tag @lucko on this one - hello Luck!

commented

This only occurs when reloading the plugin with /bukkit:reload, /lp reloadconfig works fine as far as I can tell.

commented

It would be wise if you avoid using the bukkits reload command as it can and will break plugins. You are basically forcing a plugin to shutdown without properly saving or de-establishing it's live connections to things like databases etc.. This will always cause issues like this in many plugins not just Luckperms. Since this error is only occuring when using the bukkit reload command, I doubt there will be any reason Luck will look into preventing it from happening purely because the bukkit reload command is what is causing the error to happen and not something on luckperms side.

From now on, if you wish to "reload" the config file for luckperms or any other plugin, either use that specific plugins own reload command or properly stop the server then start it again. This allows for plugins to properly do their shutdown processes and allows for the data to be properly saved and prevent corruption.

commented

I get what your saying, this was never an issue for me it's just something I noticed while testing my own plugin (Orebfuscator). I thought it would be helpful to mention this since this could be solved with a simple graceful shutdown of the pool but not knowning if that is something LuckPerms needs I though it best to just create an issue and leave it to debeat.