Re: SPI_finish and RegisterExprContextCallback - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SPI_finish and RegisterExprContextCallback
Date
Msg-id 6456.1108784841@sss.pgh.pa.us
Whole thread Raw
In response to SPI_finish and RegisterExprContextCallback  (Thomas Hallgren <thhal@mailblocks.com>)
Responses Re: SPI_finish and RegisterExprContextCallback
List pgsql-hackers
Thomas Hallgren <thhal@mailblocks.com> writes:
> AtCommitPortals (portalmem.c)  iterates over the entries in the 
> PortalHashTable. This causes a chain of calls that sometimes reach an 
> ExprContextCallback. If that callback issues a succesfull 
> SPI_cursor_close some problems might lay ahead. As the AcCommitPortals 
> iteration continues, it sometimes encounter a deleted portal and elogs 
> with an error stating "trying to delete portal name that does not exist".

The comment for AtCommit_Portals points out that there are risks of this
sort, but I don't think you've described it properly.  The
SPI_cursor_close operation is probably failing not succeeding, because
AtCommit_Portals will never find an already-deleted portal ---
hash_seq_search() shouldn't return any already-dropped entries.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: UTF8 or Unicode
Next
From: Tom Lane
Date:
Subject: Re: UTF8 or Unicode