mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
fix: do not try to reconnect infinitely
This commit is contained in:
13
repmgrd.c
13
repmgrd.c
@@ -556,7 +556,11 @@ StandbyMonitor(void)
|
|||||||
* we cannot reconnect, try to get a new master.
|
* 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(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)
|
if (PQstatus(primaryConn) != CONNECTION_OK)
|
||||||
{
|
{
|
||||||
@@ -613,7 +617,12 @@ StandbyMonitor(void)
|
|||||||
case -1:
|
case -1:
|
||||||
log_err(_("Standby node disappeared, trying to reconnect...\n"));
|
log_err(_("Standby node disappeared, trying to reconnect...\n"));
|
||||||
did_retry = true;
|
did_retry = true;
|
||||||
CheckConnection(myLocalConn, "standby");
|
|
||||||
|
if (!CheckConnection(myLocalConn, "standby"))
|
||||||
|
{
|
||||||
|
handle_sigint(0);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while(ret == -1);
|
} while(ret == -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user