pg_terminate_backend() idea

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: pg_terminate_backend() idea
Date: 2008-04-15 16:59:14
Message-ID: 200804151659.m3FGxEs17030@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Gregory Stark wrote:
> >> > Add pg_terminate_backend() to allow terminating only a single session.
>
> I'm interested in this because I was already looking for a solution to the
> "out of signals" problem we have.
>
> I think we could expand this by having a bunch of boolean flags, one each for
> different conditions including the sinval processing conditions, interrupt,
> info, and terminate. (Any more?)
>
> The two things we would have to check to be sure of is:
>
> 1) Do we care about how many times events are processed? Ie, if you press
> interrupt twice is it important that that be handled as an interrupt twice? It
> doesn't work that way currently for interrupt but are any of the other
> conditions sensitive to this? I don't think so.

Not that I can think of.

> 2) Do we care what order things happen in? Ie, if you send an info request and
> then a cancel request is it ok if the cancel is handled first. I don't see why
> not myself. And if it's a terminate request we *clear* don't want to bother
> handling any other events first.

I don't think we care.

> It seems to me we could replace all of the above with either SIGINT or USR1
> and have a bunch of boolean flags in MyProc. I'm not sure of the implication
> for sinval processing of having to get a whole bunch of LWLocks though.

Keep in mind PGPROC->terminate was easier because once it was set it was
never cleared. If you need to clear the flag and keep going the code is
going to need to be a little more sophisticated to avoid lost interrupts.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2008-04-15 17:32:09 Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single
Previous Message Andrew Dunstan 2008-04-15 16:28:25 pgsql: Add multi-line flag to regex that needs it.

Browse pgsql-hackers by date

  From Date Subject
Next Message Decibel! 2008-04-15 17:28:55 Re: Commit fest status
Previous Message Peter Eisentraut 2008-04-15 16:48:09 Re: Commit fest queue