MobHunting

MobHunting

114k Downloads

Incompatibility with LagMonitor

Maxetto opened this issue ยท 15 comments

commented

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

commented

How does your mysql settings look like in config.yml (mobhunting)?

commented

type: mysql
username: <username>
password: <password>
host: localhost:3306
database: minecraft

commented

And it fails when you have LagMonitor installed and without LagMonitor everything works?

commented

Yes, I have confirmed it instantly.

I temporarily removed LagMonitor and everything worked again.

commented

Okay I have raised an issue games647/LagMonitor#21 trying to understand why this happens.

commented

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.

commented

I don't mean going back to the old technology, I mean if it's possible to detatch it from the Main thread.

commented

How should I do this? I mean I need to access the database each time a player logon to get his statistics?

commented

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.

commented

Do you get Lag when a player joins the server?

commented

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.

commented

Please help me testing build 235 or newer. The database locking when a player joins should be removed now.

commented

Please test newest LagMonitor on his Jenkins server. The dev has made a fix. I have not tested this.

commented

The error is fixed. There's only a Warning from LagMonitor that I should report you in order to improve the Plugin. Everything works.

http://pastebin.com/kcEdhFMT

commented

Sorry for late testing. The warning is now fixed and everything works as normal. ;)