Source-X icon indicating copy to clipboard operation
Source-X copied to clipboard

MySQL and retry connection make server freeze for (60/120sec)

Open alexdan2 opened this issue 5 years ago • 3 comments

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.

alexdan2 avatar Apr 30 '20 20:04 alexdan2

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.

xwerswoodx avatar May 02 '20 11:05 xwerswoodx

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.

cbnolok avatar Oct 25 '23 08:10 cbnolok

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.

canerksk avatar Apr 23 '24 17:04 canerksk