Skip to content

Commit

Permalink
Prevent a crash during shutdown if Cluster is running
Browse files Browse the repository at this point in the history
If ProxySQL Cluster is running and the proxysql instance is shutting
down in a graceful way, Cluster was trying to access already freed
resources causing a crash.
  • Loading branch information
renecannao committed Sep 13, 2022
1 parent b45c3f6 commit 22eb7d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ProxySQL_Admin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5234,7 +5234,7 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) {
}

__run_query:
if (sess->proxysql_node_address) {
if (sess->proxysql_node_address && (__sync_fetch_and_add(&glovars.shutdown,0)==0)) {
if (sess->client_myds->active) {
const string uuid { sess->proxysql_node_address->uuid };
const string hostname { sess->proxysql_node_address->hostname };
Expand Down

0 comments on commit 22eb7d6

Please sign in to comment.