diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-25 20:31:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-25 20:31:40 +0000 |
commit | 8a6fab412e35d8495201a13d8258f26b730306f5 (patch) | |
tree | b80702276508960201ba5211b96de8c646dd76f3 /src/backend/postmaster/pgstat.c | |
parent | 691aefcf4294c8262a8bf89258250470be1046a6 (diff) |
Remove ShutdownBufferPoolAccess exit callback, and do the work in
ProcKill instead, where we still have a PGPROC with which to wait on
LWLocks. This fixes 'can't wait without a PROC structure' failures
occasionally seen during backend shutdown (I'm surprised they weren't
more frequent, actually). Add an Assert() to LWLockAcquire to help
catch any similar mistakes in future. Fix failure to update MyProcPid
for standalone backends and pgstat processes.
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r-- | src/backend/postmaster/pgstat.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 50580a8ee10..9c7795cd26e 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -16,7 +16,7 @@ * * Copyright (c) 2001, PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.28 2002/09/05 18:26:18 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.29 2002/09/25 20:31:40 tgl Exp $ * ---------- */ #include "postgres.h" @@ -314,6 +314,8 @@ pgstat_start(void) IsUnderPostmaster = true; /* we are a postmaster subprocess now */ + MyProcPid = getpid(); /* reset MyProcPid */ + /* Lose the postmaster's on-exit routines */ on_exit_reset(); @@ -1190,6 +1192,8 @@ pgstat_main(void) */ pqsignal(SIGCHLD, SIG_DFL); + MyProcPid = getpid(); /* reset MyProcPid */ + /* * Identify myself via ps */ |