Skip to content

Commit

Permalink
Always stop reconnect timer in cluster (#517)
Browse files Browse the repository at this point in the history
It needs to be explicitly stopped so that the timer handle is cleaned up
before the event loop is closed.
  • Loading branch information
mpenick authored Oct 20, 2021
1 parent 5a91c62 commit cf594b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ void Cluster::on_reconnect(ControlConnector* connector) {

void Cluster::internal_close() {
is_closing_ = true;
bool was_timer_running = timer_.is_running();
timer_.stop();
monitor_reporting_timer_.stop();
if (timer_.is_running()) {
timer_.stop();
if (was_timer_running) {
handle_close();
} else if (reconnector_) {
reconnector_->cancel();
Expand Down

0 comments on commit cf594b7

Please sign in to comment.