Re: (Never?) Kill Postmaster? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: (Never?) Kill Postmaster?
Date
Msg-id 20071111174252.GB22997@svana.org
Whole thread Raw
In response to Re: (Never?) Kill Postmaster?  (Christian Schröder <cs@deriva.de>)
List pgsql-general
On Sun, Nov 11, 2007 at 06:34:40PM +0100, Christian Schröder wrote:
> I recompiled the server with debugging symbols enabled and then did the
> following experiment: I started a query which I knew would take some
> time. While the query executed I disconnected my dial-up line. After
> reconnecting the backend process was still there (still SELECTing).
> Meanwhile the query is finished and the process is idle, but it's still
> present. I tried to "kill -SIGINT" the process and it didn't respond.
> "pg_cancel_backend" also didn't work. However, a "kill -SIGTERM" did
> kill the process (in contrast to the processes I saw before) and the
> call stack is different:

Yeah, not being able to kill processes that are waiting for I/O is
somewhat of a known problem in older versions, unsure if it's still an
issue. The issue is that the signal is set to restartable, which means
that the SIGINT signal handler gets called and then it goes right back
to waiting, rather than interrupting the system call.

In the libpq client we handle this by jumping out of the signal
handler. For the server the best bet would probably be to disable the
restartable flag for the period of socket I/O.

Not sure if this has anything to do with your main problem though.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment

pgsql-general by date:

Previous
From: Christian Schröder
Date:
Subject: Re: (Never?) Kill Postmaster?
Next
From: Tom Lane
Date:
Subject: Re: (Never?) Kill Postmaster?