mirror of
https://github.com/postgres/postgres.git
synced 2025-05-09 18:21:05 +03:00
Fix walsender handling of postmaster shutdown, to not go into endless loop.
This bug was introduced by my patch to use the regular die/quickdie signal handlers in walsender processes. I tried to make walsender exit at next CHECK_FOR_INTERRUPTS() by setting ProcDiePending, but that's not enough, you need to set InterruptPending too. On second thoght, it was not a very good way to make walsender exit anyway, so use proc_exit(0) instead. Also, send a CommandComplete message before exiting; that's what we did before, and you get a nicer error message in the standby that way. Reported by Thom Brown.
This commit is contained in:
parent
95d035e66d
commit
9c0e2b9182
@ -711,8 +711,11 @@ WalSndLoop(void)
|
||||
XLogSend(output_message, &caughtup);
|
||||
if (caughtup && !pq_is_send_pending())
|
||||
{
|
||||
ProcDiePending = true;
|
||||
continue; /* don't want to wait more */
|
||||
/* Inform the standby that XLOG streaming is done */
|
||||
pq_puttextmessage('C', "COPY 0");
|
||||
pq_flush();
|
||||
|
||||
proc_exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user