sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.05k stars 983 forks source link

The HTTP server should starts at the end of ProxySQL Admin #4510

Closed renecannao closed 7 months ago

renecannao commented 7 months ago

Up to version 2.6.2 , in ProxySQL_Admin::init() the HTTP server is started at the very beginning:

https://github.com/sysown/proxysql/blob/v2.6.2/lib/ProxySQL_Admin.cpp#L6384

If the Prometheus exporter is immediately accessible, it can attempt to access objects yet not initialized, possibly leading to a crash if the exporter is accessed within a few milliseconds from ProxySQL start.

We should probably move the initialization of AdminHTTPServer outside of ProxySQL_Admin::init() , and only initialize after all the other modules are initialized (therefore should be initialized from main().