mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
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.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user