From 6e5678315d6c7fa145053f66fe3ec01f4aaf69f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Tue, 13 Sep 2022 10:26:17 +0200 Subject: [PATCH] Fix crashes when number of servers is more than half the value of monitor 'ping|read_only' intervals --- lib/MySQL_Monitor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 3a062f2da..a826bc8ec 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -2655,6 +2655,7 @@ void * MySQL_Monitor::monitor_ping() { int us=100; if (resultset->rows_count) { us=mysql_thread___monitor_ping_interval/2/resultset->rows_count; + us = us == 0 ? 1 : us; us*=40; if (us > 1000000) { us = 10000; @@ -2926,6 +2927,7 @@ void * MySQL_Monitor::monitor_read_only() { int us=100; if (resultset->rows_count) { us=mysql_thread___monitor_read_only_interval/2/resultset->rows_count; + us = us == 0 ? 1 : us; us*=40; if (us > 1000000) { us = 10000;