From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Christian Schröder <cs(at)deriva(dot)de> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: (Never?) Kill Postmaster? |
Date: | 2007-11-11 17:42:52 |
Message-ID: | 20071111174252.GB22997@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)svana(dot)org> http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
> -- John F Kennedy
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-11-11 19:48:50 | Re: (Never?) Kill Postmaster? |
Previous Message | Christian Schröder | 2007-11-11 17:34:40 | Re: (Never?) Kill Postmaster? |