Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single
Date
Msg-id 5115.1208290826@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses pg_terminate_backend() issues  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
I wrote:
> All in all, this patch wasn't ready to apply without review.  I'm
> currently looking to see whether it's salvageable or not.

After further study, I've concluded that it is in fact not salvageable,
and I respectfully request that it be reverted.

I was able to get things to more or less work most of the time with
three or four additional ugly hacks in postgres.c, but I still don't
have any great confidence that there aren't windows where a terminate
request wouldn't be ignored (even without considering the uncooperative-
function scenario).  Moreover it's entirely unclear that this approach
actually dodges any of the hypothetical bugs in SIGTERM handling.
Given the complexity that it adds, I think it's fair to say that this
approach is probably buggier than the other way.

I think if we want pg_terminate_backend, we have to do it the way that
was originally discussed: have it issue SIGTERM and fix whatever needs
to be fixed in the SIGTERM code path.  As the TODO list used to say
before it got editorialized upon, this is mostly a matter of testing
(something that I can tell this patch was sadly lacking :-().
We do need also to go around and fix any places that think a PG_TRY
block is a sufficient way to clean up state in shared memory --- cf
this AFAIK-still-unfixed bug:
http://archives.postgresql.org/pgsql-hackers/2007-04/msg00218.php
        regards, tom lane


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Commit fest queue
Next
From: Bruce Momjian
Date:
Subject: pg_terminate_backend() issues