diff options
| author | Tom Lane | 2006-05-30 17:08:20 +0000 |
|---|---|---|
| committer | Tom Lane | 2006-05-30 17:08:20 +0000 |
| commit | 7788c43152d85c175cafce0bfeec395a7f3c29bf (patch) | |
| tree | f31b8ae2bf4c5df3dc3063a8f4c501b2c07dad5a /src | |
| parent | 53409f1b37a363fe27142bf124ae6812b5565620 (diff) | |
PostmasterIsAlive test really ought to be in the inner loop for safety.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/postmaster/pgarch.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 73995c9043f..bd5bd8bcd31 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -19,7 +19,7 @@ * * * 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 * while we are still copying earlier archives */ - while (PostmasterIsAlive(true) && pgarch_readyXlog(xlog)) + while (pgarch_readyXlog(xlog)) { int failures = 0; for (;;) { + /* Abandon processing if we notice our postmaster has died */ + if (!PostmasterIsAlive(true)) + return; + if (pgarch_archiveXlog(xlog)) { /* successful */ |
