Skip to content

Commit 3993bd8

Browse files
committed
PostmasterIsAlive test really ought to be in the inner loop for safety.
1 parent 03f9636 commit 3993bd8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/postmaster/pgarch.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*
2121
* IDENTIFICATION
22-
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.21 2006/05/30 13:30:49 momjian Exp $
22+
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.22 2006/05/30 17:08:14 tgl Exp $
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
@@ -352,12 +352,16 @@ pgarch_ArchiverCopyLoop(void)
352352
* some backend will add files onto the list of those that need archiving
353353
* while we are still copying earlier archives
354354
*/
355-
while (PostmasterIsAlive(true) && pgarch_readyXlog(xlog))
355+
while (pgarch_readyXlog(xlog))
356356
{
357357
int failures = 0;
358358

359359
for (;;)
360360
{
361+
/* Abandon processing if we notice our postmaster has died */
362+
if (!PostmasterIsAlive(true))
363+
return;
364+
361365
if (pgarch_archiveXlog(xlog))
362366
{
363367
/* successful */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy