Re: [ANNOUNCEMENT] Updated: cygrunsrv-0.94-1

From: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
To: cygwin(at)cygwin(dot)com
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: [ANNOUNCEMENT] Updated: cygrunsrv-0.94-1
Date: 2001-07-18 19:11:42
Message-ID: 20010718151142.B612@dothill.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin

Corinna,

On Mon, Jul 16, 2001 at 06:27:27PM +0200, Corinna Vinschen wrote:
> Perhaps changing Cygwin from sending SIGHUP to sending SIGTERM makes
> any sense?

Yes, I believe that this is the way to go -- at least for PostgreSQL...

On Mon, Jul 16, 2001 at 11:51:00AM -0500, Fred Yankowski wrote:
> Sending SIGTERM rather than SIGHUP does seem more appropriate for this
> case in general. However, it might not work well for PostgreSQL.

I appear to have empirical evidence that indicates that PostgreSQL
can tolerate receiving SIGTERM and/or SIGINT during an NT shutdown.

My procedure is as follows:

1. I applied the attached patch, rebuilt my Cygwin DLL, and
installed it.

2. I installed postmaster under cygrunsrv as follows:

$ cygrunsrv --install postmaster --path /usr/bin/postmaster \
--args "-D /usr/share/postgresql/data -i" --dep ipc-daemon \
--termsig INT --user 'bhmco\jt' --shutdown

3. I connected to this postmaster via psql running on another machine.

4. I restarted this NT box.

The following are the messages displayed during shutdown and startup:

Smart Shutdown request at Wed Jul 18 14:00:32 2001 [1]
FATAL 1: This connection has been terminated by the administrator. [2]
DEBUG: shutting down
Fast Shutdown request at Wed Jul 18 14:00:33 2001 [3]
DEBUG: database system is shut down
DEBUG: database system was shut down at 2001-07-18 14:00:35

[restart occurs here]

DEBUG: CheckPoint record at (0, 63186000)
DEBUG: Redo record at (0, 63186000); Undo record at (0, 0); Shutdown TRUE
DEBUG: NextTransactionId: 11662; NextOid: 414368
DEBUG: database system is in production state [4]

Message [1] is due to ctrl_c_handler() sending a SIGTERM instead of
SIGHUP to the postmaster process. Message [2] is due to ctrl_c_handler()
sending a SIGTERM to the backend postgres process that is serving the
only connection (from psql) which causes it to terminate. Note that
normally it is postmaster that sends this signal (not some other process).
Message [3] is due to cygrunsrv responding to the NT shutdown message
and in turn sending a SIGINT to postmaster. Note that this seems to
indicate that a Fast Shutdown can interrupt and supersede a Smart one.
Message [4] indicates that PostgreSQL was able to restart without any
manual intervention.

Although the above is not quite how PostgreSQL shutdowns on other
platforms, it is very close and seems to work.

Should I submit the attached patch (with ChangeLog) to cygwin-patches
for consideration?

Thanks,
Jason

--
Jason Tishler
Director, Software Engineering Phone: 732.264.8770 x235
Dot Hill Systems Corp. Fax: 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

Attachment Content-Type Size
exceptions.cc.patch text/plain 609 bytes

In response to

Responses

Browse pgsql-cygwin by date

  From Date Subject
Next Message Corinna Vinschen 2001-07-18 20:20:11 Re: [ANNOUNCEMENT] Updated: cygrunsrv-0.94-1
Previous Message Jason Tishler 2001-07-18 12:37:04 Re: Fwd: Cygwin CVS breaks PostgreSQL drop table