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().
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 ofProxySQL_Admin::init()
, and only initialize after all the other modules are initialized (therefore should be initialized frommain()
.