MySQL and retry connection make server freeze for (60/120sec)
Hello, when sphere lost link to MySQL server and retry to connect but fail for network down all server freeze and wait timeout of sql connection retry When timeout end or new link up server back to run.
Console Message
22:08:ERROR:MySQL server link has been lost. Trying to reattach to it.
I not know if is normal because mysql run on same thread of core. but is not very good this.
Hmm, if I remember correct this is really old issue, when mysql can't connect to server it causes lag, but I am not sure what can do for that, because I haven't check how mysql works on sphere, maybe the progress could move to backwards to avoid server lagging but I am not sure if it's possible.
Is this still a issue, since we moved to a recent MariaDB version? If it's the case, a possible solution would be to try to connect to the db in another thread, and having an atomic bool inside a GlobalStates struct wrapper to check if Sphere is connected to the db and can run the query.
This partly depends on where the SQL server is hosted. I don't think there would be such a problem on a local SQL server. If you haven't stopped the sql service. These problems generally occur on remote mysql servers. I recommend that you run the SQL server on the same machine as the sphere server.