Rosewood-Development / PlayerPoints

A free plugin for points currency (with SQL support)
GNU General Public License v3.0
61 stars 47 forks source link

Server Lag when `<name>` does not exist in the database + Duplicated UUID Entry Error #20

Closed denniemok closed 2 years ago

denniemok commented 3 years ago

1. Server Lag when <name> does not exist in the database If the <name> parameter is someone that does not exist in the database, then the server will lag for around 0.5 second. I guess that's because the plugin is trying to search the whole database for that <name>.

A potential fix is to put that player data searching utility into a BukkitRunnable Async task.

2. Duplicated UUID Entry Error Somehow when multiple servers are connected to the same MySQL database, sometimes there will be duplicated UUID error spamming the console. Not sure why that happened though. But I guess that's a fail-safe feature. An error occurred executing a MySQL query: Duplicate entry 'some uuid here' for key 'uuid

maybe you can suppress that error?

3. Request to remove /p alias This is because many plugins use /p, like party plugin, mcmmo plugin, etc.

Esophose commented 2 years ago

I believe these issues were all resolved other than the point for 3 which will be changed in a future update, going to close.

denniemok commented 2 years ago

Thanks sir.

I ran into a quite serious issue when updating to the latest version of PlayerPoints (v3.2.0).

These are the errors (spamming the console):

[06:01:11] [ERROR]: [hread - 39482] [PlayerPoints] An error occurred executing a MySQL query: HikariPool-1 - Connection is not available, request timed out after 30000ms. [06:01:11] [WARN]: [hread - 39482] java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms. [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.libs.rosegarden.lib.hikaricp.pool.HikariPool.createTimeoutException(HikariPool.java:696) [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.libs.rosegarden.lib.hikaricp.pool.HikariPool.getConnection(HikariPool.java:197) [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.libs.rosegarden.lib.hikaricp.pool.HikariPool.getConnection(HikariPool.java:162) [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.libs.rosegarden.lib.hikaricp.HikariDataSource.getConnection(HikariDataSource.java:100) [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.libs.rosegarden.database.MySQLConnector.connect(MySQLConnector.java:52) [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.manager.DataManager.getOnlineTopSortedPointPositions(DataManager.java:277) [06:01:11] [WARN]: [hread - 39482] at org.black_ixx.playerpoints.manager.LeaderboardManager.refresh(LeaderboardManager.java:69) [06:01:11] [WARN]: [hread - 39482] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(SourceFile:67) [06:01:11] [WARN]: [hread - 39482] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(SourceFile:61) [06:01:11] [WARN]: [hread - 39482] at org.github.paperspigot.ServerSchedulerReportingWrapper.run(SourceFile:30) [06:01:11] [WARN]: [hread - 39482] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [06:01:11] [WARN]: [hread - 39482] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [06:01:11] [WARN]: [hread - 39482] at java.lang.Thread.run(Thread.java:748)

Note that this does not happen in v3.1.1. And when this happens, the server lags quite badly and people cannot join the server. I have a few servers using this plugin while connecting to the same database. Not sure if that causes the issue. But it is fine in v.3.1.1. Just happens out of nowhere since v3.2.0.

Esophose commented 2 years ago

If you join my Discord server I can send you a jar with that fixed, otherwise I'll have v3.2.1 released probably tomorrow.

denniemok commented 2 years ago

Thank you sir. I will test the new version later on!