fix fclose and switch context
This commit is contained in:
@ -2720,8 +2720,14 @@ static void do_switchover(uint32 term)
|
||||
pg_log(PG_WARNING, _("\n switchover timeout after %d seconds. please manually check the cluster status or backtrack log.\n"), wait_seconds);
|
||||
|
||||
if ((sofile = fopen(switchover_timeout_file, "w")) == NULL) {
|
||||
pg_log(
|
||||
PG_WARNING, _(" could not create switchover timeout signal file \"%s\": %s\n"), switchover_timeout_file, strerror(errno));
|
||||
pg_log(PG_WARNING, _(" could not create switchover timeout signal file \"%s\": %s\n"),
|
||||
switchover_timeout_file, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
if (fclose(sofile)) {
|
||||
pg_log(PG_WARNING, _(" could not write switchover timeout signal file \"%s\": %s\n"), switchover_timeout_file,
|
||||
strerror(errno));
|
||||
sofile = NULL;
|
||||
exit(1);
|
||||
}
|
||||
sig = SIGUSR1;
|
||||
|
@ -662,7 +662,6 @@ void print_all_stack()
|
||||
PG_CATCH();
|
||||
{
|
||||
/* Must reset elog.c's state */
|
||||
(void)MemoryContextSwitchTo(g_instance.stat_cxt.GsStackContext);
|
||||
ErrorData* edata = CopyErrorData();
|
||||
FlushErrorState();
|
||||
appendStringInfo(&result, "%s", edata->message);
|
||||
|
Reference in New Issue
Block a user