Re: [PATCH] plpython function causes server panic - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] plpython function causes server panic
Date
Msg-id 20231202013007.cogjqyc7cingzitu@awork3.anarazel.de
Whole thread Raw
In response to Re: [PATCH] plpython function causes server panic  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] plpython function causes server panic
List pgsql-hackers
Hi,

On 2023-12-01 20:04:15 -0500, Tom Lane wrote:
> Hao Zhang <zhrt1446384557@gmail.com> writes:
> > I found a problem when executing the plpython function:
> > After the plpython function returns an error, in the same session, if we
> > continue to execute
> > plpython function, the server panic will be caused.
> 
> Thanks for the report!  I see the problem is that we're not expecting
> BeginInternalSubTransaction to fail.  However, I'm not sure I like
> this solution, mainly because it's only covering a fraction of the
> problem.  There are similarly unsafe usages in plperl, pltcl, and
> very possibly a lot of third-party PLs.  I wonder if there's a way
> to deal with this issue without changing these API assumptions.

There are plenty other uses, but it's not clear to me that they are similarly
affected by BeginInternalSubTransaction raising an error? It e.g. doesn't
immediately look like plperl's usage would be affected in a similar way?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: processes stuck in shutdown following OOM/recovery
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] plpython function causes server panic