From 8a6fab412e35d8495201a13d8258f26b730306f5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 25 Sep 2002 20:31:40 +0000 Subject: 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. --- src/backend/tcop/postgres.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 0b713f25a48..6b49bdba6c5 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.293 2002/09/20 03:45:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.294 2002/09/25 20:31:40 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1163,6 +1163,13 @@ PostgresMain(int argc, char *argv[], const char *username) } } + /* + * initialize globals (already done if under postmaster, but not if + * standalone; cheap enough to do over) + */ + + MyProcPid = getpid(); + /* * Fire up essential subsystems: error and memory management * @@ -1691,7 +1698,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.293 $ $Date: 2002/09/20 03:45:08 $\n"); + puts("$Revision: 1.294 $ $Date: 2002/09/25 20:31:40 $\n"); } /* -- cgit v1.2.3