LuckPerms

LuckPerms

41.4k Downloads

LuckPerms is unable to recover from a MariaDB backend downtime

sgdc3 opened this issue · 6 comments

commented

LP is unable to reconnect to my MariaDB server if the connection gets lost, the only way is to restart the server instance.
The console starts spamming this exception (https://paste.lucko.me/WXyKKPvvkC) and players are unable to join the server.
If i try to connect to the remote database via bash it works as expected, so I'm sure this isn't an issue with my database software or firewall rules.

commented

Any other plugin using that database is able to recover from the connection loss, LP is the only one that just fails to reconnect.

commented

Tbh, having a auto-reconnect option wouldn't be a bad idea (if LP doesn't have this already)
But you should also try to prevent the downtime of the database...
When a database goes down unintended is that not good and should be prevented somehow.

commented

The error tells me otherwise.
It clearly tells you that it couldn't establish a connection within 5000 milliseconds (5 seconds) which can mean one of these things

  • Your database cridentials are wrong (unlikely)
  • Your database timed out/went offline (likely)
  • The connection between LP and the database was cut (likely)

I myself can't see a cause on LPs end as this is an error from Hikari which LP uses for database connections.
I would make sure to double-check that your database doesn't go down (randomly) as it should stay online as long as the server is.

commented

But you should also try to prevent the downtime of the database...
When a database goes down unintended is that not good and should be prevented somehow.

Hello Captain Obvious nice to see you. But if you don’t mind let’s focus on the issue at hand instead of throwing around pointless advise that does nothing to solve the issue. I mean it’s like saying “Oh your car seat belt broke? Just don’t get into any accidents. Then you don’t need it in the first place.”

commented

Sounds like a tweak of the Hikari config could fix this.

I'll try to look into it as some point, would appreciate it if anyone else could have a look into it too.

commented

Did some research, seems it's likely because a socket timeout wasn't being set.

https://github.com/brettwooldridge/HikariCP/wiki/Rapid-Recovery

I've applied the fixes detailed above to hopefully resolve the problem. If someone could test I'd be grateful :)

(it may take ~30 seconds after the DB comes back online for the plugin to start connecting again)