When a player enters a dungeon game, Essentials will refresh the permissions of all players. This will cause the server to get stuck
Crysta11ize opened this issue · 7 comments
Type of bug
Performance issue or memory leak
/ess version
output
ess version
§6Server版本:§a1.17.1-R0.1-SNAPSHOT git-Tuinity-"dc9d19c" (MC: 1.17.1)
§6Brand版本:§aTuinity
§6EssentialsX版本:§a2.19.0-dev+226-17e026f
§6Vault版本:§a1.7.3-b131
§6EssentialsXProtect版本:§a2.19.0-dev+226-17e026f
§6EssentialsXGeoIP版本:§a2.19.0-dev+226-17e026f
§6EssentialsXAntiBuild版本:§a2.19.0-dev+226-17e026f
§6EssentialsXSpawn版本:§a2.19.0-dev+226-17e026f
§6Citizens版本:§a2.0.28-SNAPSHOT (build 2359)
§6Economy Layer: §rNone
§6正在获取版本信息...
Server startup log
https://gist.github.com/Crysta11ize/1621e8e5c2d3a5776ea50685b2b4f814
EssentialsX config files
https://gist.github.com/Crysta11ize/3cb2c11f4f30da11c6c767c23cd383e1
Error log (if applicable)
https://gist.github.com/Crysta11ize/337f8c47653e7d792df33d15cac508f3
Bug description
When a player enters a DungeonXL game, Essentials will refresh the permissions of all players. This will cause the server to get stuck
Steps to reproduce
Install
DungeonsXL and EssentialsX
Then use /dxl play
to start a dungeon game
Expected behaviour
Shouldn't cause lag
Actual behaviour
This will cause a stuck for a few seconds
We have to address that this issue is getting worse when the server is running long enough. After players come and go for a while, the main server thread is being hanged longer and longer each time. Eventually our server passes the default 60s watchdog and then crashed.
For now we have to frequently restart server (in the middle of the ady) to prevent crashes, yet it is still not a permanent fix.
If you need any more info to debug please let us know, we would like to provide helps. Thank you!
Essentials doesn't call for the recalculation of permissions and recalculation shouldn't be that expensive. Have you tried migrating to LuckPerms as they may be able to help you with the lag issue you're having with permissions.
We are using zPermissions with MySQL. Currently has no plan to switch due to large data size and it is deeply integrated into our other systems.
/dxl play
will create new worlds ad-hoc. Perhaps this might trigger the recalculation?
Probably has something to do with zPermissions, unless you can reproduce with other permission plugins. I also like to point out that zPermissions has basically been out of development...
We have trace the issue to this line of code:
Since we are running our own permission plugin, so we just try to comment it out. Then everything works fine without lags.
And it seems that we don't need the built in default permissions. Is it possible to auto-disable this feature while using vault's permissions, or have an option in the config.yml
so we can turn it off?
That won’t invoke a permission recalculation that will lag or hang your server. It is simply registering a permission node. Many plugins does that. If your permission plugin can’t handle it properly then consider getting a better one. Luckperm is generally recommended and looks like a better alternative then whatever you use currently.
Going to mark this as a wontfix, this isn't Essentials' fault that your permission plugin cannot reasonable handle the normal operation of adding a permission into the bukkit permission registry. My best guess is that your permissions plugin does MySQL operations on the main thread which is very bad and probably shouldn't be done.