diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 84ce70b65..3b3b4e9b0 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -337,6 +337,7 @@ MySQL_HostGroups_Manager::MySQL_HostGroups_Manager() { status.server_connections_connected=0; status.server_connections_aborted=0; status.server_connections_created=0; + status.server_connections_delayed=0; status.servers_table_version=0; pthread_mutex_init(&status.servers_table_version_lock, NULL); pthread_cond_init(&status.servers_table_version_cond, NULL); diff --git a/lib/ProxySQL_Cluster.cpp b/lib/ProxySQL_Cluster.cpp index 5b3c0d95b..77c8159eb 100644 --- a/lib/ProxySQL_Cluster.cpp +++ b/lib/ProxySQL_Cluster.cpp @@ -167,6 +167,7 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) { } if (conn->net.vio) { mysql_close(conn); + conn = NULL; } } else { proxy_warning("Cluster: unable to connect to peer %s:%d . Error: %s\n", node->hostname, node->port, mysql_error(conn)); @@ -180,7 +181,7 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) { } } __exit_monitor_thread: - //if (conn) { + if (conn) if (conn->net.vio) { mysql_close(conn); } diff --git a/src/main.cpp b/src/main.cpp index 5938af4c7..052cc1cb9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,7 +208,7 @@ MySQL_STMT_Manager_v14 *GloMyStmt; #endif MySQL_Monitor *GloMyMon; -std::thread *MyMon_thread; +std::thread *MyMon_thread = NULL; MySQL_Logger *GloMyLogger; @@ -505,7 +505,7 @@ void ProxySQL_Main_join_all_threads() { } // join GloMyMon thread - if (GloMyMon) { + if (GloMyMon && MyMon_thread) { cpu_timer t; MyMon_thread->join(); #ifdef DEBUG