Closed Infernus101 closed 5 years ago
Try the mysql-ping branch. I didn't test it, but it would fix the issue.
okay, i am testing it, do you know what causes this? so i can reproduce it to test.
It happens if there are no queries for a long time (depending on your MySQL configuration).
An alternative way to fix this is to change your MySQL settings for connection timeout. But MySQL configuration is very annoying.
True, also will it be a problem if too many players join at the same time and there are too many queries to run?
Usually, this only happens if there are too few queries. If this happens because of too many queries, perhaps some mechanism has identified your connection as a DoS and disconnected you, or the traffic is so high that it throttled, or some miscellaneous reasons. In these cases, it is not the responsibility of libasynql to fix.
No i mean will it be a problem if all async workers are busy?
Each async worker has its own MySQL connection. Disconnections happen independently. In addition, libasynql has its own async pool, so it shouldn't be the case.
Getting this error: SQL PREPARE error: MySQL server has gone away, for query SELECT Environment OS: Linux