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:
@ -1055,3 +1055,16 @@ void mon_log_state_change(MONITOR_SERVERS *ptr)
|
||||
free(prev);
|
||||
free(next);
|
||||
}
|
||||
|
||||
void mon_hangup_failed_servers(MONITOR *monitor)
|
||||
{
|
||||
for (MONITOR_SERVERS *ptr = monitor->databases; ptr; ptr = ptr->next)
|
||||
{
|
||||
if (mon_status_changed(ptr) &&
|
||||
(!(SERVER_IS_RUNNING(ptr->server)) ||
|
||||
!(SERVER_IS_IN_CLUSTER(ptr->server))))
|
||||
{
|
||||
dcb_hangup_foreach(ptr->server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user