Re: [HACKERS] ERROR: infinite recursion in proc_exit - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] ERROR: infinite recursion in proc_exit
Date
Msg-id 199911061945.OAA04497@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] ERROR: infinite recursion in proc_exit  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] ERROR: infinite recursion in proc_exit  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> That isn't going to make things any better, because it's still laboring
> under the same basic oversight: elog(ERROR) does not return to the
> caller, it returns control to the main loop.  Thus, having proc_exit
> call elog(ERROR) is simply *guaranteed* to create a failure.  proc_exit
> must not allow control to return anywhere, under any circumstances,
> because it is used as the final recourse when things are too screwed up
> to consider continuing.

Massimo pointed out some problems in my fix.  The new code is:
   if (++proc_exit_inprogress == 9)         elog(ERROR, "infinite recursion in proc_exit");   if (proc_exit_inprogress
>=9)       goto exit;      /* ----------------    *  if proc_exit_inprocess > 1, then it means that we    *  are being
invokedfrom within an on_exit() handler    *  and so we return immediately to avoid recursion.      * ----------------
 */   if (proc_exit_inprogress > 1)         return;
 

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] ERROR: infinite recursion in proc_exit
Next
From: Kristofer Munn
Date:
Subject: Arrays broken on temp tables