repmgrd: don't explicitly close connections on shutdown

This commit is contained in:
Ian Barwick
2018-04-30 15:13:30 +09:00
parent 635bdccb2c
commit 6f315c1b3c
3 changed files with 0 additions and 33 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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)