Cause of "can't wait without a PROC structure"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Cause of "can't wait without a PROC structure"
Date: 2002-09-25 15:52:57
Message-ID: 8126.1032969177@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Shattuck 2002-09-25 15:57:25 Re: Cause of "can't wait without a PROC structure"
Previous Message Jan Wieck 2002-09-25 15:33:33 Re: New SSL code to be removed