Skip site navigation (1) Skip section navigation (2)

Re: SIGTERM does not stop backend postgres processes immediately

From: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
To: Fred Yankowski <fred(at)ontosys(dot)com>
Cc: pgsql-cygwin(at)postgresql(dot)org, cygwin(at)cygwin(dot)com
Subject: Re: SIGTERM does not stop backend postgres processes immediately
Date: 2001-05-09 18:26:29
Message-ID: 20010509142629.J355@dothill.com (view raw or flat)
Thread:
Lists: pgsql-cygwin
Fred,

On Wed, May 09, 2001 at 09:40:31AM -0500, Fred Yankowski wrote:
> The problem I'm seeing, where a postgres backend process doesn't react
> immediately to SIGTERM, occurs even when there is only one such
> backend process, so this may be a different problem from the one
> described in those earlier threads and recently fixed in CVS.

This is my assessment too.

> I'm seeing this problem as I test my patch for running postgres as an
> NT service.  But I just tried running postmaster directly from the
> shell and I see the same problem.

I was able to reproduce your finding under Cygwin too.  When I repeated
the experiment under Linux, postmaster shutdown as expected.

> I know from inserting printfs into the backend code that the SIGTERM
> signal handler function is not being called right after the stop
> request.  Rather, it is called only after the backend gets some data
> over its input socket connection, from that "\d" in did in pg_ctl in
> this case.  It seems that the recv() call deep in the backend code
> does not get interrupted by the SIGTERM.

IMO, you have found a Cygwin bug.  Please report it to the Cygwin list.
Hopefully, Mr. Signal is listening and will jump into action...
Can you produce a minimal test case that demonstrates the problem?

> On Tue, May 08, 2001 at 10:05:19PM -0400, Jason Tishler wrote:
> > However, I have not built PostgreSQL with Cygwin 1.3.1 -- I have only run
> > it against Cygwin 1.3.1.  What happens when you run make check?  Does the
> > postmaster exit cleanly at the end of the regression test as expected?
> 
> I'm a little confused about the distinction you're making between
> "Cygwin 1.3.1" and "Cygwin 1.3.1".  ;-)

Sorry, for being unclear.  What I was trying to say was that my builds
of PostgreSQL are really against Cygwin 1.1.8 (with only cygwin1.dll
replaced to workaround the mmap/fork problem).  I have never built
against Cygwin 1.3.1.  However, I do run against Cygwin 1.3.1 on one of
my test machines.

> Anyway, "make check" completes without any errors.  No apparent hangs.

Which again confirms that this is a different and yet to be solved
problem.

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason(dot)Tishler(at)dothill(dot)com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

In response to

Responses

pgsql-cygwin by date

Next:From: Christopher FaylorDate: 2001-05-09 20:49:26
Subject: Re: SIGTERM does not stop backend postgres processes immediately
Previous:From: Fred YankowskiDate: 2001-05-09 14:40:31
Subject: Re: SIGTERM does not stop backend postgres processes immediately

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group