fix: do not try to reconnect infinitely

This commit is contained in:
Christian Kruse
2014-01-10 17:26:02 +01:00
parent dcdf8788ae
commit 91446bcf93

View File

@@ -556,7 +556,11 @@ StandbyMonitor(void)
* we cannot reconnect, try to get a new master.
*/
CheckConnection(primaryConn, "master"); /* this take up to local_options.reconnect_attempts * local_options.reconnect_intvl seconds */
CheckConnection(myLocalConn, "standby");
if (!CheckConnection(myLocalConn, "standby"))
{
handle_sigint(0);
}
if (PQstatus(primaryConn) != CONNECTION_OK)
{
@@ -613,7 +617,12 @@ StandbyMonitor(void)
case -1:
log_err(_("Standby node disappeared, trying to reconnect...\n"));
did_retry = true;
CheckConnection(myLocalConn, "standby");
if (!CheckConnection(myLocalConn, "standby"))
{
handle_sigint(0);
}
break;
}
} while(ret == -1);