mirror of
https://github.com/postgres/postgres.git
synced 2025-05-29 16:21:20 +03:00
PostmasterIsAlive test really ought to be in the inner loop for safety.
This commit is contained in:
parent
53409f1b37
commit
7788c43152
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.18.2.1 2006/05/30 13:31:01 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.18.2.2 2006/05/30 17:08:20 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -352,12 +352,16 @@ pgarch_ArchiverCopyLoop(void)
|
|||||||
* some backend will add files onto the list of those that need archiving
|
* some backend will add files onto the list of those that need archiving
|
||||||
* while we are still copying earlier archives
|
* while we are still copying earlier archives
|
||||||
*/
|
*/
|
||||||
while (PostmasterIsAlive(true) && pgarch_readyXlog(xlog))
|
while (pgarch_readyXlog(xlog))
|
||||||
{
|
{
|
||||||
int failures = 0;
|
int failures = 0;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
/* Abandon processing if we notice our postmaster has died */
|
||||||
|
if (!PostmasterIsAlive(true))
|
||||||
|
return;
|
||||||
|
|
||||||
if (pgarch_archiveXlog(xlog))
|
if (pgarch_archiveXlog(xlog))
|
||||||
{
|
{
|
||||||
/* successful */
|
/* successful */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user