LuckPerms

LuckPerms

41.4k Downloads

Add option to throw `ServerThreadLookupException` silently

molor opened this issue ยท 3 comments

commented

Description

Currently, if some [shitty] plugin will do bad/stupid things (e.g. lookup an UUID for player that was disconnected several hours ago) then LP will prevent it from doing this and throws an ServerThreadLookupException, that will result in ~75+ lines being printed to the server console & saved to logs. And it's lucky if it happens just once, not every second.. or tick :/

Of course I agree that this is an issue of some [shitty] plugin, not LP. But its development may be discontinued, or the developer may not be interested in changing something.

Proposed Behaviour

Add something like vault-silent-unsafe-lookups-warning that will still throw ServerThreadLookupException "under the server's hood" but it will not be printed in the server console and logs. So if it is true then just don't print anything in that case.

Or print a warning consisting of just one line, e.g. Some plugin doing bad things. Set "vault-silent-unsafe-lookups-warning" to "false" to see the detailed error.

Extra Details

No response

commented

Throwing an exception that "will not be printed in the server console and logs" is not really a thing, the exception is thrown to, broadly speaking, abruptly interrupt the process that was "incorrectly" using Vault, but whether it's printed or not highly depends on the context it was originally called from.

I can see the value in having a setting to reduce the message and perhaps not convey the entire call stack (although, the idea to include that is to point out the plugin performing the call), but still throw the exception to interrupt the process.

Additionally, be aware that you can enable the vault-unsafe-lookups setting, this will simply not throw the exception and load the user data from storage, although it does await for that to complete so if the storage latency is too high, it can lead to undesirable tick slowdowns when it happens.

# If Vault lookups for offline players on the main server thread should be enabled.
#
# LuckPerms has a "catch" for plugins attempting to perform unsafe offline player data lookups
# from the main server thread. This catch raises an exception (causes an error to occur) when unsafe
# lookups are made, instead of allowing the lookup to happen, which would likely cause the server
# to lag.
#
# However, if you're willing to accept the consequences, the catch can be disabled by setting this
# option to 'true.
vault-unsafe-lookups: false

commented

Yeah, thanks, I know about that setting. In my case I don't want to allow [shitty] plugin to slowdown my server w/o any warnings (or just turn that warnings into one line message), not allow it and get rid of warnings. But there's no way to do that, so I created this issue.

commented

Sorry - there's nothing we can really do aside from the options that are available already. How downstream plugins do their error handling isn't something we can control