Ban Management

Ban Management

193k Downloads

Database sync only occurs every 10 minutes

dyaizon opened this issue · 4 comments

commented

Database sync is occuring every 10 minutes, not every 10 ticks.
Verified by checking schedules.yml and noting timestamp changes.

I assume the cause of the error is down to Bukkit, since the usage of the runTaskTimerAsynchronously API seems correct. However I've noticed this API is now deprecated and was wondering whether that could case the issue.

This can be removed by making BmRunnable a subclass of BukkitRunnable, and then calling runTaskTimerAsynchronously on it rather than the plugin scheduler. I haven't been able to test this due to errors when compiling:
[ERROR] Failed to execute goal on project BanManager: Could not resolve dependencies for project me.confuser:BanManager:jar:5.7.2-SNAPSHOT: Failed to collect dependencies for [org.bukkit:bukkit:jar:1.7.10-R0.1-SNAPSHOT (provided), com.sk89q:guavabackport:jar:1.1 (compile), com.j256.ormlite:ormlite-core:jar:4.48 (compile), com.j256.ormlite:ormlite-jdbc:jar:4.48 (compile), org.mcstats.bukkit:metrics-lite:jar:R6 (compile), me.confuser:BukkitPluginUtil:jar:1.5.3 (compile), com.googlecode.concurrent-trees:concurrent-trees:jar:2.4.0 (compile), org.projectlombok:lombok:jar:1.14.2 (provided), net.gravitydevelopment.updater:updater:jar:2.3 (compile), com.google.code.gson:gson:jar:2.3.1 (compile), commons-net:commons-net:jar:3.3 (compile), com.github.spullara.cli-parser:cli-parser:jar:1.1.2 (compile), com.maxmind.geoip2:geoip2:jar:2.2.0 (compile)]: Failed to read artifact descriptor for me.confuser:BukkitPluginUtil:jar:1.5.3: Could not transfer artifact me.confuser:BukkitPluginUtil:pom:1.5.3 from/to confuser-repo (http://ci.frostcast.net/plugin/repository/everything): Failed to transfer file: http://ci.frostcast.net/plugin/repository/everything/me/confuser/BukkitPluginUtil/1.5.3/BukkitPluginUtil-1.5.3.pom. Return code is: 522 , ReasonPhrase:Origin Connection Time-out. -> [Help 1]

commented

BukkitRunnable was deprecated, not Runnable. The times in scheduler are in
seconds, not ticks. The scheduler makes use of bukkits thread pool. If
there are too many async tasks running, it may be slowed down.

On 1 Dec 2015 20:04, "dyaizon" [email protected] wrote:

Database sync is occuring every 10 minutes, not every 10 ticks.
Verified by checking schedules.yml and noting timestamp changes.

I assume the cause of the error is down to Bukkit, since the usage of the
runTaskTimerAsynchronously API seems correct. However I've noticed this API
is now deprecated and was wondering whether that could case the issue.

This can be removed by making BmRunnable a subclass of BukkitRunnable,
and then calling runTaskTimerAsynchronously on it rather than the plugin
scheduler.


Reply to this email directly or view it on GitHub.

commented

OK, regardless of which one was deprecated (although https://hub.spigotmc.org/javadocs/bukkit/ does suggest that BukkitScheduler.runTaskTimerAsynchrously is deprecated), it is a 10 minute sync rather than 10 seconds. Are there any logs/debug I can provide?

commented

No, it states use of runTaskTimerAsynchrously methods using BukkitRunnable is deprecated, which BanManager has never used. Therefore, this is a red herring.

The slow down of your scheduled tasks could be due to a slow MySQL connection. As of v5.7, I changed it to a single thread to avoid an underlying issue with the orm library this plugin is using. Meaning if one scheduled task takes a little too long, it'll have a knock on effect on the others; a risk I considered as acceptable to prevent syncing from not working in its entirety.

Check the latency between your minecraft server and database.

commented

This should be fixed in the latest developer build