Re: pg_terminate_backend idea

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_terminate_backend idea
Date: 2005-06-22 08:02:41
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE6C76F6@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > But it still requires me to send some data (such as a dummy
> query) to
> > the backend before it exits. This is because server side
> libpq blocks
> > when reading and ignores signals at this time. I believe
> the fix for
> > this would be to pass a flag down to the libpq routines
> that we want
> > to be abort in case of signal+flag, set only when doing the "main
> > call" to recv, so we can kill idle process.
>
> Yech! That code is messy enough already, lets not pile
> another kluge atop it in order to handle something that's not
> even being requested AFAIR.

While I agree it'sa bit of a cludge, saying that it's not requested is
absolutely and totally untrue. It has been requested *a lot*. People
even use a method that is now *known* to be unsafe, simply because we do
not provide another alternative.

Therefor, I prefer a kludge than nothing at all. But a "proper solution"
is of course better.

> In any case the correct way to solve the problem is to find
> out what's being left corrupt by SIGTERM, rather than install
> more messiness in order to avoid facing the real issue ...

That is unfortunatly way over my head. And it doesn't seem like anybody
who actually has what it takes to do the "proper solution" is interested
in doing it.

//Magnus

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2005-06-22 08:14:56 Re: pg_terminate_backend idea
Previous Message Dave Page 2005-06-22 08:00:49 Re: Server instrumentation patch