Subject: Re: SIGTERM does not stop backend postgres processes immediately
From: Jason Tishler <[email-masked]>
To: [email-masked]
Cc: Pgsql-Cygwin <[email-masked]>
Date: Tue, 15 May 2001 10:10:36 -0400

Corrina,

On Tue, May 15, 2001 at 11:20:54AM +0200, Corinna Vinschen wrote:
> On Fri, May 11, 2001 at 09:09:28AM +1000, Robert Collins wrote:
> > Blueskying a concept here: what about cygwin opening all sockets in
> > non-blocking mode, and if the app thinks that it is a blocking call wait
> > on the socket && on a signal event?
> > 
> > Obviously not trivial to get working right, but
> > a) would it work on 95?
> > b) thoughts?
> 
> b) I have just applied a patch to Cygwin which uses overlapped IO
>    together with the Winsock2 calls WSARecv, WSARecvFrom, WSASend
>    and WSASendTo if available. The new mechanism is interruptable
>    by signals. If Winsock2 is not available the new implementation
>    just falls back to using the non-inerruptable Winsock1 calls.
> 
>    I would like to ask people to test it especially in conjunction
>    with PostgreSQL, which I haven't set up.

I just tried my Cygwin PostgreSQL 7.1.1 distribution against the latest
Cygwin CVS and the above mentioned patch solves the postmaster shutdown
problem.  Now Cygwin PostgreSQL behaves identical to UNIX PostgreSQL
with regard to shutdown:

1. pg_ctl stop (i.e., kill -s SIGTERM) causes postmaster to wait for
all clients to disconnect before shutting down.

2. pg_ctl -m fast stop (i.e., kill -s SIGINT) causes postmaster to
shutdown immediately (but cleanly) without waiting for all clients
to disconnect.

Your patch fixed case 2 above and I believe this is the last piece needed
by Fred Yankowski to complete his PostgreSQL NT service patch.

Thank you very much for this patch -- it is really appreciated.

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: [email-masked]
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple