I investigated the problem and found out that, the crashes happen after any of the plugins using MySQL are reloaded. Looks like after a plugin is reloaded, it can't any longer exectue SQL queries in a separate thread and all quaries are executed in the main thread.
I guess eather
PHP Code:
pPlugin->GetProperty("DisallowDBThreads", NULL)
or
PHP Code:
!g_DBMan.AddToThreadQueue(op, PrioQueue_High)
returns true for reloaded plugins.
To test my assumption I created a reloader plugin. It reloads all plugins when map changes.
If there are no plugins using MySQL - everything is fine, but when I add one, the server goes to boot loop (if the MySQL server is switched off).
The problem might be in (DBManager::OnPluginWillUnload):
https://github.com/alliedmodders/sou...c/Database.cpp
Also it might switch unfinished threaded queries to non-threaded and block the main thread... not sure if it works this way though.
Is it a bug ?