mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
repmgrd: don't explicitly close connections on shutdown
This commit is contained in:
@@ -74,7 +74,6 @@ static FailoverState follow_new_primary(int new_primary_id);
|
||||
static FailoverState witness_follow_new_primary(int new_primary_id);
|
||||
|
||||
static void reset_node_voting_status(void);
|
||||
void close_connections_physical();
|
||||
|
||||
static bool do_primary_failover(void);
|
||||
static bool do_upstream_standby_failover(void);
|
||||
@@ -2940,19 +2939,3 @@ format_failover_state(FailoverState failover_state)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
close_connections_physical()
|
||||
{
|
||||
if (PQstatus(primary_conn) == CONNECTION_OK)
|
||||
{
|
||||
/* cancel any pending queries to the primary */
|
||||
if (PQisBusy(primary_conn) == 1)
|
||||
{
|
||||
log_debug("cancelling query on primary");
|
||||
cancel_query(primary_conn, config_file_options.async_query_timeout);
|
||||
}
|
||||
close_connection(&primary_conn);
|
||||
}
|
||||
|
||||
close_connection(&upstream_conn);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ void do_physical_node_check(void);
|
||||
void monitor_streaming_primary(void);
|
||||
void monitor_streaming_standby(void);
|
||||
void monitor_streaming_witness(void);
|
||||
void close_connections_physical(void);
|
||||
|
||||
void handle_sigint_physical(SIGNAL_ARGS);
|
||||
|
||||
|
||||
15
repmgrd.c
15
repmgrd.c
@@ -53,9 +53,6 @@ bool startup_event_logged = false;
|
||||
MonitoringState monitoring_state = MS_NORMAL;
|
||||
instr_time degraded_monitoring_start;
|
||||
|
||||
static void close_connections(void);
|
||||
void (*_close_connections) (void) = NULL;
|
||||
|
||||
/*
|
||||
* Record receipt of SIGHUP; will cause configuration file to be reread
|
||||
* at the appropriate point in the main loop.
|
||||
@@ -404,7 +401,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
_close_connections = close_connections_physical;
|
||||
log_debug("node id is %i, upstream node id is %i",
|
||||
local_node_info.node_id,
|
||||
local_node_info.upstream_node_id);
|
||||
@@ -801,20 +797,9 @@ print_monitoring_state(MonitoringState monitoring_state)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
close_connections()
|
||||
{
|
||||
if (_close_connections != NULL)
|
||||
_close_connections();
|
||||
|
||||
close_connection(&local_conn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
terminate(int retval)
|
||||
{
|
||||
close_connections();
|
||||
logger_shutdown();
|
||||
|
||||
if (pid_file)
|
||||
|
||||
Reference in New Issue
Block a user