From fec1698db52e825fcff8bd6c333439985a79aead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 12 Feb 2020 13:05:17 +0200 Subject: [PATCH] MXS-2889: Fix Replicator hang on shutdown If a connection to the servers cannot be made, the replicator thread would never exit. --- server/modules/routing/avrorouter/replicator.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/modules/routing/avrorouter/replicator.cc b/server/modules/routing/avrorouter/replicator.cc index 5b7149921..9bbd7498d 100644 --- a/server/modules/routing/avrorouter/replicator.cc +++ b/server/modules/routing/avrorouter/replicator.cc @@ -221,6 +221,11 @@ void Replicator::Imp::process_events() { if (!connect()) { + if (m_should_stop) + { + break; + } + // We failed to connect to any of the servers, try again in a few seconds std::this_thread::sleep_for(milliseconds(5000)); continue;