Incompatibility with LagMonitor
Maxetto opened this issue ยท 15 comments
When I tried to add THIS build of LagMonitor, MobHunting won't connect to MySQL database.
This plugin is the only one that couldn't connect.
No errors on start, just THIS everytime someone joins the server.
I guess the problem is in MysqlDataSource, causing an SQLException:
https://github.com/Rocologo/MobHunting/blob/master/src/one/lindegaard/MobHunting/storage/MySQLDataStore.java#L54
Using:
Spigot 1.8.8
MobHunting 4.2.4
type: mysql
username: <username>
password: <password>
host: localhost:3306
database: minecraft
And it fails when you have LagMonitor installed and without LagMonitor everything works?
Yes, I have confirmed it instantly.
I temporarily removed LagMonitor and everything worked again.
Okay I have raised an issue games647/LagMonitor#21 trying to understand why this happens.
Using DriverManager instead of MySQLDataSource would be like using old techology. So I dont plan to do so :-)
http://stackoverflow.com/questions/15198319/why-do-we-use-a-datasource-instead-of-a-drivermanager
https://blogs.oracle.com/javajungle/entry/performance_test_drivermanager_vs_datasource
I close the ticket now, since it seems to work again.
I don't mean going back to the old technology, I mean if it's possible to detatch it from the Main thread.
How should I do this? I mean I need to access the database each time a player logon to get his statistics?
I don't really know. I don't have much of knowledge, but I believe you could try running it in the scheduler
.runTaskAsynchronously(Plugin, Runnable).
Since it's very improbable someone would kill a Mob on the next tick, this could do the trick.
I can't really tell. It might go down to 19.80~99.
Someone with a remote/slow MySQL database could face thread locks and server crashes.
Please help me testing build 235 or newer. The database locking when a player joins should be removed now.
Please test newest LagMonitor on his Jenkins server. The dev has made a fix. I have not tested this.
The error is fixed. There's only a Warning from LagMonitor that I should report you in order to improve the Plugin. Everything works.