BG-Software-LLC / SuperiorSkyblock2

Optimized, feature packed Skyblock core.
https://bg-software.com/superiorskyblock/
GNU General Public License v3.0
159 stars 134 forks source link

Slow plugin loading #1814

Closed ArDiDEx closed 10 months ago

ArDiDEx commented 11 months ago

Minecraft's Version

This server is running Pufferfish version git-Pufferfish-69 (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) (Git: 19a70d2 on HEAD)

Plugin's Version

SuperiorSkyblock2 version 2023.2

Describe the bug

The plugin takes around 2 minutes to load the islands, after doing a background profiler with spark to find out what takes so long to load on startup, 80% of the startup is dedicated to island chest deserialization (we have around ~3k islands)

To Reproduce

have 3k islands start server with spark background profiler /spark profiler stop

Additional Information

image

OmerBenGera commented 11 months ago

Not really concerning me. It is obviously takes more time as you have more data to load.

LuluxClient commented 11 months ago

I'm having the same issue and I currently have plugins like playervaultX which takes about 3-5s to load with 10-20 times more data so I don't know what you can do to make it faster since it takes 1-3 minutes to load for no reasons...

OmerBenGera commented 11 months ago

Send me a link to the spark profiler please.

TopeEstLa commented 11 months ago

Hey, here is the spark profiler link https://spark.lucko.me/5GSSrbNyPp

OmerBenGera commented 11 months ago

@LuluxClient @TopeEstLa Check out latest dev build, it should be better. It won't be as good as it can be on the first runs, as the plugin needs to serialize the chests again to see any effect.

Give it some time, then test it again in a few days.

LuluxClient commented 11 months ago

@LuluxClient @TopeEstLa Check out latest dev build, it should be better.

It won't be as good as it can be on the first runs, as the plugin needs to serialize the chests again to see any effect.

Give it some time, then test it again in a few days.

Thanks <3 will try soon !

OmerBenGera commented 11 months ago

@ArDiDEx @LuluxClient Have you tried it?

ArDiDEx commented 11 months ago

@ArDiDEx @LuluxClient Have you tried it?

Not yet, I totally forgot to update superiorskyblock, going to update it tonight and i'll tell u if anything changed in the next few days

ArDiDEx commented 11 months ago

Hey! Seems to be working fine when i add items to the island chest and reach the update counter and it thus manually saves but on shutdown it does this error (and I added an item before shutting down so it would do a future save)

[00:57:58] [Server thread/ERROR]: [SuperiorSkyblock2] An unexpected error occurred while disabling the plugin:
[00:57:58] [Server thread/WARN]: java.lang.IllegalArgumentException: Illegal group reference
[00:57:58] [Server thread/WARN]:    at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067)
[00:57:58] [Server thread/WARN]:    at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:997)
[00:57:58] [Server thread/WARN]:    at java.base/java.util.regex.Matcher.replaceFirst(Matcher.java:1407)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.StatementHolder.populateStatement(StatementHolder.java:127)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.StatementHolder.lambda$execute$2(StatementHolder.java:86)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.session.QueryResult.complete(QueryResult.java:34)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.session.RemoteSQLSession.customQuery(RemoteSQLSession.java:124)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.SQLHelper.customQuery(SQLHelper.java:85)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.StatementHolder.executeQuery(StatementHolder.java:116)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.StatementHolder.execute(StatementHolder.java:85)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.SQLDatabaseBridge.executeStatementHolder(SQLDatabaseBridge.java:178)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.sql.SQLDatabaseBridge.insertObject(SQLDatabaseBridge.java:115)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.bridge.IslandsDatabaseBridge.lambda$saveIslandChest$61(IslandsDatabaseBridge.java:473)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.bridge.IslandsDatabaseBridge.runOperationIfRunning(IslandsDatabaseBridge.java:750)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.bridge.IslandsDatabaseBridge.saveIslandChest(IslandsDatabaseBridge.java:473)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.core.database.bridge.IslandsDatabaseBridge.executeFutureSaves(IslandsDatabaseBridge.java:703)
[00:57:58] [Server thread/WARN]:    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
[00:57:58] [Server thread/WARN]:    at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.island.GridManagerImpl.saveIslands(GridManagerImpl.java:823)
[00:57:58] [Server thread/WARN]:    at SuperiorSkyblock2-2023.2.jar//com.bgsoftware.superiorskyblock.SuperiorSkyblockPlugin.onDisable(SuperiorSkyblockPlugin.java:346)
[00:57:58] [Server thread/WARN]:    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281)
[00:57:58] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:224)
[00:57:58] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:148)
[00:57:58] [Server thread/WARN]:    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:92)
[00:57:58] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:528)
[00:57:58] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_19_R3.CraftServer.disablePlugins(CraftServer.java:486)
[00:57:58] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:949)
[00:57:58] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.t(DedicatedServer.java:807)
[00:57:58] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1215)
[00:57:58] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:322)
[00:57:58] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:833)
WarnDa commented 11 months ago

It creates a lot of issues and reset chests of player.. :/

OmerBenGera commented 11 months ago

It creates a lot of issues and reset chests of player.. :/

Does it happen due to converting old data to new one, or when saving new chests? Also, are there any errors?

WarnDa commented 11 months ago

It creates a lot of issues and reset chests of player.. :/

Does it happen due to converting old data to new one, or when saving new chests? Also, are there any errors?

All their data were first resetted (they had 0 chests) I used "/is admin setchestrow 6 6" to make them getting chests again, and next day it was still resetted (so no chest unlocked) Yes error on loading : https://pastebin.com/p9PJ9Tcj

Here is database table of island chests : https://mega.nz/file/08tGXKCS#V0W159qk-7C56y1yBRuqjw_FzjAs28y8l049DOWgRyM Whole database : https://discord.com/channels/554276823010246687/1104389601302413483/1139272700146233374

OmerBenGera commented 11 months ago

@WarnDa Should be fixed in latest dev build I don't know if the old data will be restored (It should be unless it was overridden), but it shouldn't happen anymore

WarnDa commented 11 months ago

@WarnDa Should be fixed in latest dev build I don't know if the old data will be restored (It should be unless it was overridden), but it shouldn't happen anymore

There is still the same error on b67 https://pastebin.com/eBtCzJw9

OmerBenGera commented 11 months ago

@WarnDa What is the column type of the contents column in island_chests table?

WarnDa commented 11 months ago

@WarnDa What is the column type of the contents column in island_chests table?

IMG_1889

OmerBenGera commented 11 months ago

Well, it might still occur due to the old issues, as this shouldn't occur anymore. Try it on a fresh setup and you'll see it doesn't happen.

WarnDa commented 11 months ago

Well, it might still occur due to the old issues, as this shouldn't occur anymore. Try it on a fresh setup and you'll see it doesn't happen.

So how can I do for people with bugged chest ? They won't get their chest back ? And if I re-set them chests and they fill it, it will reset them again?

WarnDa commented 10 months ago

Edit : If I give again chests to an island and they put items inside, it restes after a restart and they got no chests unlocked.

WarnDa commented 10 months ago

I had to delete completely the is chests colum from the database and restart, and now it works, but every player lost his data

OmerBenGera commented 10 months ago

@WarnDa If you deleted the chests column, then obviously all the data would be wiped out. If you have an example of a value that causes issues, I can test it myself and fix it if needed.

WarnDa commented 10 months ago

@WarnDa If you deleted the chests column, then obviously all the data would be wiped out. If you have an example of a value that causes issues, I can test it myself and fix it if needed.

You can try the database I gave you on discord and try to update to the latest .jar But for me it's fine I resetted all the player chests

OmerBenGera commented 10 months ago

@WarnDa If you deleted the chests column, then obviously all the data would be wiped out. If you have an example of a value that causes issues, I can test it myself and fix it if needed.

You can try the database I gave you on discord and try to update to the latest .jar But for me it's fine I resetted all the player chests

The DB you gave me contains tons of entries of island chests. I'd like a specific one that causes the issues.

WarnDa commented 10 months ago

@WarnDa If you deleted the chests column, then obviously all the data would be wiped out. If you have an example of a value that causes issues, I can test it myself and fix it if needed.

You can try the database I gave you on discord and try to update to the latest .jar But for me it's fine I resetted all the player chests

The DB you gave me contains tons of entries of island chests. I'd like a specific one that causes the issues.

I don't have bugged database anymore, so we can just close it then

OmerBenGera commented 10 months ago

This issue was not opened by you. @LuluxClient @ArDiDEx what about you?

OmerBenGera commented 10 months ago

I am closing this as it should be better. If the issue continues, let me know