in src/failover/cluster_topology_monitor.cc [122:143]
void ClusterTopologyMonitor::Run() {
std::string c = StringHelper::ToString(this->conn_str_);
try {
LOG(INFO) << "Start cluster topology monitoring thread for " << c;
while (is_running_.load()) {
bool should_handle_topology_timing = true;
// Panic if main monitor is not connected to the writer instance
if (in_panic_mode()) {
should_handle_topology_timing = handle_panic_mode();
} else {
should_handle_topology_timing = handle_regular_mode();
}
if (should_handle_topology_timing) {
handle_ignore_topology_timing();
}
}
LOG(INFO) << "Stop cluster topology monitoring thread for " << c;
} catch (const std::exception& ex) {
LOG(ERROR) << "Cluster Topology Main Monitor encountered error: " << ex.what();
}
}