From 86b099b487bab968a7da7a86d91773ea652a45be Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 3 May 2019 15:00:00 +0300 Subject: [PATCH] MXS-2468 When the URLs change, HTTP GET must be cancelled If the nodes change while a multi HTTP GET is in process, the corresponding delayed called must be cancelled. Otherwise we eventually would end up attempting to update the state of the nodes using the wrong result. --- .../modules/monitor/clustrixmon/clustrixmonitor.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/modules/monitor/clustrixmon/clustrixmonitor.cc b/server/modules/monitor/clustrixmon/clustrixmonitor.cc index 2e24ad5d8..0a2f808bc 100644 --- a/server/modules/monitor/clustrixmon/clustrixmonitor.cc +++ b/server/modules/monitor/clustrixmon/clustrixmonitor.cc @@ -925,7 +925,18 @@ void ClustrixMonitor::update_http_urls() health_urls.push_back(url); } - m_health_urls.swap(health_urls); + if (m_health_urls != health_urls) + { + if (m_delayed_http_check_id != 0) + { + cancel_delayed_call(m_delayed_http_check_id); + m_delayed_http_check_id = 0; + } + + m_http.reset(); + + m_health_urls.swap(health_urls); + } } bool ClustrixMonitor::perform_softfail(SERVER* pServer, json_t** ppError)