Add option to throw `ServerThreadLookupException` silently
molor opened this issue ยท 3 comments
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
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.
LuckPerms/bukkit/src/main/resources/config.yml
Lines 632 to 641 in 8fbd791
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.