ToberoCat / ImprovedFactions

Factions plugin for minecraft
GNU General Public License v3.0
14 stars 11 forks source link

[Bug] Server freezes after successfully loading improved factions papi extension #178

Closed Specifix5 closed 2 months ago

Specifix5 commented 5 months ago

Describe the bug This bug occurs when Dynmap and papi 2.11.6 are both present with ImprovedFactions (currently experiencing this issue in 2.2.0-stable and 2.2.0 built from source)

The server freezes for tens of minutes, even almost taking an hour and suddenly resuming to normal, Paper does not detect it as a "server not responding" so there is no stack trace or heap dump whatsoever.

This issue however isn't present when either Dynmap or Papi is missing

Error log from console when All three plugins are present No errors but this is what the console says before entering the freezing state:

[14:27:05 INFO]: [PlaceholderAPI] Loading server plugin PlaceholderAPI v2.11.6
[14:27:07 INFO]: [ImprovedFactions] Loading server plugin ImprovedFactions v2.2.0
[14:27:07 INFO]: [dynmap] Loading server plugin dynmap v3.7-beta-5-943
[14:27:07 INFO]: [dynmap] version=1.20.6-145-fe7043e (MC: 1.20.6)
[14:27:07 INFO]: [dynmap] Mod Support API available
...
[14:27:28 INFO]: [dynmap] Enabling dynmap v3.7-beta-5-943
[14:27:28 INFO]: [dynmap] Added 20 custom biome mappings
[14:27:28 INFO]: [dynmap] Using GroupManager 3.2 (Phoenix) for access control
[14:27:29 INFO]: [dynmap] Found cwebp at C:\libwebp-1.4.0-windows-x64\bin\cwebp.exe and dwebp at C:\libwebp-1.4.0-windows-x64\bin\dwebp.exe: webp format enabled
[14:27:29 INFO]: [dynmap] Mod Support processing completed
[14:27:32 INFO]: [dynmap] Loaded 27 shaders.
[14:27:32 INFO]: [dynmap] Loaded 83 perspectives.
[14:27:32 INFO]: [dynmap] Loaded 22 lightings.
[14:27:32 INFO]: [dynmap] Starting enter/exit processing
[14:27:32 INFO]: [dynmap] Finish marker initialization
[14:27:32 INFO]: [dynmap] Web server started on address 0.0.0.0:8123
[14:27:32 INFO]: [dynmap] version 3.7-beta-5-943 is enabled - core version 3.7-beta-5-943
[14:27:32 INFO]: [dynmap] For support, visit our Discord at https://discord.gg/s3rd5qn
[14:27:32 INFO]: [dynmap] For news, visit https://reddit.com/r/Dynmap or follow https://universeodon.com/@dynmap
[14:27:32 INFO]: [dynmap] To report or track bugs, visit https://github.com/webbukkit/dynmap/issues
[14:27:32 INFO]: [dynmap] If you'd like to donate, please visit https://www.patreon.com/dynmap or https://ko-fi.com/michaelprimm
[14:27:32 INFO]: [dynmap] Loaded 1 maps of world 'world'.
[14:27:32 INFO]: [dynmap] World 'world_nether' disabled
[14:27:32 INFO]: [dynmap] World 'world_the_end' disabled
[14:27:32 INFO]: [dynmap] Enabled
...
[14:27:34 INFO]: [ImprovedFactions] Enabling ImprovedFactions v2.2.0
[14:27:35 INFO]: [ImprovedFactions] Checking for updates...
[14:27:35 INFO]: [ImprovedFactions] Config is up to date
[14:27:35 WARN]: [ImprovedFactions] No whitelisted worlds found in config. Allowing all worlds
[14:27:36 INFO]: [ImprovedFactions] Using database SQLITE as database
[14:27:38 INFO]: [ImprovedFactions] Loaded module power-raids
[14:27:38 INFO]: [ImprovedFactions] Loaded module dynmap
[14:27:38 INFO]: [ImprovedFactions] Loaded module home
[14:27:38 INFO]: [ImprovedFactions] Loaded module chat
[14:27:38 INFO]: [ImprovedFactions] Loaded module claim-particles
[14:27:38 INFO]: [PlaceholderAPI] Successfully registered internal expansion: faction [1.0.0]
[14:27:38 INFO]: [ImprovedFactions] Loaded improved factions papi extension
>

Error logs from the console when papi is missing but Dynmap and IF are present:

[15:25:08 INFO]: [dynmap] Found cwebp at C:\libwebp-1.4.0-windows-x64\bin\cwebp.exe and dwebp at C:\libwebp-1.4.0-windows-x64\bin\dwebp.exe: webp format enabled
[15:25:08 INFO]: [dynmap] Mod Support processing completed
[15:25:11 INFO]: [dynmap] Loaded 27 shaders.
[15:25:11 INFO]: [dynmap] Loaded 83 perspectives.
[15:25:11 INFO]: [dynmap] Loaded 22 lightings.
[15:25:11 INFO]: [dynmap] Starting enter/exit processing
[15:25:11 INFO]: [dynmap] Finish marker initialization
[15:25:11 INFO]: [dynmap] Web server started on address 0.0.0.0:8123
[15:25:11 INFO]: [dynmap] version 3.7-beta-5-943 is enabled - core version 3.7-beta-5-943
[15:25:11 INFO]: [dynmap] For support, visit our Discord at https://discord.gg/s3rd5qn
[15:25:11 INFO]: [dynmap] For news, visit https://reddit.com/r/Dynmap or follow https://universeodon.com/@dynmap
[15:25:11 INFO]: [dynmap] To report or track bugs, visit https://github.com/webbukkit/dynmap/issues
[15:25:11 INFO]: [dynmap] If you'd like to donate, please visit https://www.patreon.com/dynmap or https://ko-fi.com/michaelprimm
[15:25:11 INFO]: [dynmap] Loaded 1 maps of world 'world'.
[15:25:11 INFO]: [dynmap] World 'world_nether' disabled
[15:25:11 INFO]: [dynmap] World 'world_the_end' disabled
[15:25:11 INFO]: [dynmap] Enabled
[15:25:11 INFO]: [ImprovedFactions] Enabling ImprovedFactions v2.2.0
[15:25:12 INFO]: [ImprovedFactions] Checking for updates...
[15:25:12 INFO]: [ImprovedFactions] Config is up to date
[15:25:13 WARN]: [ImprovedFactions] No whitelisted worlds found in config. Allowing all worlds
[15:25:13 INFO]: [ImprovedFactions] Using database SQLITE as database
[15:25:15 INFO]: [ImprovedFactions] Loaded module power-raids
[15:25:15 INFO]: [ImprovedFactions] Loaded module dynmap
[15:25:15 INFO]: [ImprovedFactions] Loaded module home
[15:25:15 INFO]: [ImprovedFactions] Loaded module chat
[15:25:15 INFO]: [ImprovedFactions] Loaded module claim-particles
[15:25:15 INFO]: [ImprovedFactions] Papi not found. Skipping Papi registration
> help
[15:25:30 INFO]: Running delayed init tasks
[15:25:30 INFO]: Done (37.499s)! For help, type "help"
[15:25:30 INFO]: Timings Reset
[15:25:30 INFO]: --------- Help: Index ---------------------------
[15:25:30 INFO]: Use /help [n] to get page n of help.
[15:25:30 INFO]: Aliases: Lists command aliases
[15:25:30 INFO]: Bukkit: All commands for Bukkit
[15:25:30 INFO]: dynmap: All commands for dynmap
[15:25:30 INFO]: ImprovedFactions: All commands for ImprovedFactions
[15:25:30 INFO]: Minecraft: All commands for Minecraft
[15:25:30 INFO]: /advancement: A Mojang provided command.

Server just proceeded to load like normal, strange..

To Reproduce Steps to reproduce the behavior:

  1. Start an Empty 1.20.6 paper-145 server
  2. Have the following plugins: Dynmap-3.7-beta-5, Placeholder API 2.11.6, ImprovedFactions 2.2.0
  3. Server will freeze after "[ImprovedFactions] Loaded improved factions papi extension" message without any stack trace error from paper

Expected behavior Server resume loading as usual like when either plugins are not present

Screenshots image

Version (please complete the following information):

Additional context Full logs when 3 plugins are present: latest.log

Full logs when papi is missing: latest.log

Specifix5 commented 5 months ago

Btw this happens in my Ubuntu VPS too, both using java openjdk 21.0.3 2024-04-16 LTS OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) so I suppose this isn't an issue with java version or even platform differences

ToberoCat commented 5 months ago

Very interesting. I tried to reproduce it, but it loads normally. Used the latest version of dynmap and papi, as well as the latest IF dev build

Specifix5 commented 5 months ago

Will test later when I get home but then I suppose its a jre issue? Are you using OpenJDK 21.0.3 LTS from Adoptium?

ToberoCat commented 5 months ago

I suspect that not papi takes for ever to load, but the claim indexing process does. Try it with the newest version, as this will give some more insights about it

Specifix5 commented 5 months ago

Yep, that caused it, but why take so long just because there's placeholder API? It doesn't happen when it doesnt have P api

Edit: Without P API

[11:31:25] [Server thread/INFO]: [ImprovedFactions] [detector] Detecting clusters...
[11:31:25] [Server thread/INFO]: [ImprovedFactions] [detector] Loading faction and zone positions..
[11:31:25] [Server thread/INFO]: [ImprovedFactions] [detector] Positions: 9627 Faction | 0 Zone. This might take some time
[11:31:25] [Server thread/INFO]: [ImprovedFactions] [detector] Finished loading zone positions.
[11:33:13] [Thread-21/INFO]: [ImprovedFactions] [detector] Finished loading faction positions.
[11:33:13] [Server thread/INFO]: [ImprovedFactions] [detector] All done!

With P API

[11:49:38 INFO]: [ImprovedFactions] [detector] Detecting clusters...
[11:49:38 INFO]: [ImprovedFactions] [detector] Loading faction and zone positions..
[11:49:38 INFO]: [ImprovedFactions] [detector] Positions: 9627 Faction | 0 Zone. This might take some time
[11:49:38 INFO]: [ImprovedFactions] [detector] Finished loading zone positions.
> (still not even loading faction clusters as of writing this)

faction clusters just takes exponentially long to load with placeholder API enabled?

ToberoCat commented 2 months ago

Has been fixed with caching indexed clusters in database. Will be included in next build