I've identified the reason for the occasional "can't wait without a PROC
structure" failures we've seen reported.  I had been thinking that this
must occur during backend startup, before MyProc is initialized ...
but I was mistaken.  Actually, it happens during backend shutdown,
and the reason is that ProcKill (which releases the PGPROC structure
and resets MyProc to NULL) is called before ShutdownBufferPoolAccess.
But the latter tries to acquire the bufmgr LWLock.  If it has to wait,
kaboom.

The ordering of these shutdown hooks is the reverse of the ordering
of the startup initialization of the modules.  It looks like we'll
need to rejigger the startup ordering ... and it also looks like that's
going to be a rather ticklish issue.  (See comments in BaseInit and
InitPostgres.)  Any thoughts on how to do it?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to