MXS-2889: Fix Replicator hang on shutdown

If a connection to the servers cannot be made, the replicator thread would
never exit.
This commit is contained in:
Markus Mäkelä
2020-02-12 13:05:17 +02:00
parent 3fc20d4345
commit fec1698db5

View File

@ -221,6 +221,11 @@ void Replicator::Imp::process_events()
{ {
if (!connect()) if (!connect())
{ {
if (m_should_stop)
{
break;
}
// We failed to connect to any of the servers, try again in a few seconds // We failed to connect to any of the servers, try again in a few seconds
std::this_thread::sleep_for(milliseconds(5000)); std::this_thread::sleep_for(milliseconds(5000));
continue; continue;