Do hangups only after server states have been updated
The hangup code was refactored into a common function which should only be used after the server states have been updated. This will remove erroneus connections to already failed servers.
This commit is contained in:
@ -599,15 +599,6 @@ monitorMain(void *arg)
|
||||
/* monitor current node */
|
||||
monitorDatabase(mon, ptr);
|
||||
|
||||
if (mon_status_changed(ptr))
|
||||
{
|
||||
if (!(SERVER_IS_RUNNING(ptr->server)) ||
|
||||
!(SERVER_IS_IN_CLUSTER(ptr->server)))
|
||||
{
|
||||
dcb_hangup_foreach(ptr->server);
|
||||
}
|
||||
}
|
||||
|
||||
if (mon_status_changed(ptr) ||
|
||||
mon_print_fail_status(ptr))
|
||||
{
|
||||
@ -679,6 +670,8 @@ monitorMain(void *arg)
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
|
||||
mon_hangup_failed_servers(mon);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user