Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [GENERAL] (Never?) Kill Postmaster?

From: Martijn van Oosterhout <kleptog(at)svana.org>
Date: Sun Nov 11 2007 - 12:42:52 EST


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.org>   
http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
> -- John F Kennedy
Received on Sun Nov 11 12:45:21 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 19:40:26 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library