Open Nelpsen opened 4 years ago
The server starts to wait, when the queue from the accumulated SQL_ThreadQuery will be completed or will not be timed out, if the database is unavailable, the server will freeze and will wait.
There is no such problem in sourcemod, the card change does not wait for the queue to end, and after the card change the queue continues to try to send requests.
AMXModX 1.9.0
I'm pretty sure Source mod does the same thing if the database is unavailable. Can confirm its happened when we switched hosts and had to wait for our databases to migrate.
This is normal behavior, honestly don't see a solution or method to fix this.
The server starts to wait, when the queue from the accumulated SQL_ThreadQuery will be completed or will not be timed out, if the database is unavailable, the server will freeze and will wait. There is no such problem in sourcemod, the card change does not wait for the queue to end, and after the card change the queue continues to try to send requests. AMXModX 1.9.0
I'm pretty sure Source mod does the same thing if the database is unavailable. Can confirm its happened when we switched hosts and had to wait for our databases to migrate.
This is normal behavior, honestly don't see a solution or method to fix this.
Do not wait for the completion of the request queue at the time of the card change, but continue to execute the queue after the card is changed.
What query your plugin is running? You can explain better? To be honest i think that can be fixed using other moment to save the data than map change.
What query your plugin is running? You can explain better? To be honest i think that can be fixed using other moment to save the data than map change.
The status of the players is updated during disconnect, the disconnect of all players is triggered when the card is changed. If the database is unavailable, the server will wait for the queue to complete.
The workaround was to change the mysql_timeout cvar to 5 seconds.
There is a small fix for the module; when a card is changed, the queue is recorded temporarily in a file and, after its change, continues to attempt execution.
It was what I was going to suggest. Anyway SQL do not have a better design to save players data.
Are you sure that you are not missed thread query with Execute's(which are blocking)? Can you provide any examples?
If you run SQL_ThreadQuery in plugin_end event, server will hang until the query return results to handler.
Ok, im gonna check, im pretty sure that u are wrong.
@SmileYzn ok, u are right, yes, external sleep on mysql causing server also stop working (on mapchanges only, yes) (not actualy stoped, just slept for 20 seconds)...
That's strange. So, we need to implement SQL_ThreadQuery2 for real non-blocking, but rn SQL_ThreadQuery fixing problem that when we close connection (on server deactivate post) on mysql queries in queues also dropped without execution. But actually they aren't blocking on nonmap changes as u said, it's ok for me, just ask dvander for some suggestions, idk, he implemented this.
SQL_ThreadQuery is just based on ServerFrame also some code on OnPluginsUnloading, while this is there, can't be "fixed".
AMX Mod X unloads plugins on map change, which means flushing database queues. SourceMod persists plugins across maps. You'd see the same problem on SourceMod if you tried to unload the plugin.
Probably the only option here would be to specify that some queries are allowed to complete with no feedback (eg if it succeeds or fails, the plugin would never know).
The server starts to wait, when the queue from the accumulated SQL_ThreadQuery will be completed or will not be timed out, if the database is unavailable, the server will freeze and will wait.
There is no such problem in sourcemod, the card change does not wait for the queue to end, and after the card change the queue continues to try to send requests.
AMXModX 1.9.0