Re: [HACKERS] Terminating a backend - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [HACKERS] Terminating a backend
Date
Msg-id 200804121618.m3CGIYa03346@momjian.us
Whole thread Raw
In response to Re: [HACKERS] Terminating a backend  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> >> When we get the termination signal, why can't we just set a global
> >> boolean, do a query cancel, and in the setjmp() code block check the
> >> global and exit --- at that stage we know we have released all locks and
> >> can exit cleanly.
>
> > I have implemented this idea with the attached patch.
>
> It was already explained to you why this is a bad idea.

Yes, I remember your comments:

    http://archives.postgresql.org/pgsql-hackers/2008-03/msg00145.php

    Keep in mind that 99% of the excuse for people to want to use SIGTERM is
    that the backend isn't responding to SIGINT.  If you've fixed things so
    that SIGTERM cannot get them out of any situation that SIGINT doesn't
    get them out of, I don't think it's a step forward.

    ...

    [shrug...]  They can do that now, most of the time.  What this is about
    is dealing with corner cases, and in that respect what your proposal
    will do is replace soluble problems with insoluble ones.  But I suppose
    I can't stop you if you're insistent.

I need more than one person to tell me it is a bad idea because I think
it is a good idea.

If we tell people SIGTERM is not safe to use then why is making it safe
worse.  And if it is safe, we can just add a function to enable SIGTERM
to the backend without doing the query cancel longjump().

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Terminating a backend
Next
From: Gavin Sherry
Date:
Subject: datum passed to macro which expects a pointer