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

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

From: Fred Yankowski <fred(at)ontosys(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-12 16:42:08
Message-ID: 20010712114208.A11408@enteract.com (view raw or flat)
Thread:
Lists: pgsql-cygwin
On Thu, Jul 12, 2001 at 11:45:39AM -0400, Jason Tishler wrote:
> Please post your patch -- I've been waiting with bated breath since you
> first mentioned it.  :,)  I will be quite willing to champion it (or a
> better solution, if one can be devised) for inclusion into PostgreSQL CVS.

OK, here's the patch.  It's crude, simply causing the SIGHUP handlers
(one for postmaster and one for postgres) to return immediately
without triggering the normal config-file-reloading response.

BTW, while testing this patch again after a 'cvs update' I notice that
I've got more 'postgres' processes running than usual.  In the idle
state I expect to have just one process named 'postgres' running; it's
actually the postmaster and has cygrunsrv as its parent.  But now I've
got two other postgres processes, one a child of the postmaster and
the other a child of the first.  I don't remember seeing this before.
I don't have any client programs running.  Stopping and restarting the
service results in the same situation.  Starting a client causes a new
postgres child process of the postmaster to run while the client is
connected, as usual.  I'm puzzled about those two other processes.

-- 
Fred Yankowski           fred(at)OntoSys(dot)com      tel: +1.630.879.1312
Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

--

Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/postmaster/postmaster.c,v
retrieving revision 1.229
diff -u -p -r1.229 postmaster.c
--- src/backend/postmaster/postmaster.c 2001/06/29 16:05:57     1.229
+++ src/backend/postmaster/postmaster.c 2001/07/12 16:34:29
@@ -1284,6 +1284,18 @@ SIGHUP_handler(SIGNAL_ARGS)
        int                     save_errno = errno;

        PG_SETMASK(&BlockSig);
+#ifdef __CYGWIN__
+       /*
+        * Ignore SIGHUP since Cygwin sends a SIGHUP when NT is being
+        * shut down.  Attempting to handle this signal as normal
+        * seems to block the concurrent activity to shutdown the
+        * postmaster.
+        */
+       if (DebugLvl)
+         postmaster_error("ignoring caught SIGHUP in postmaster");
+       errno = save_errno;
+       return;
+#endif

        if (Shutdown <= SmartShutdown)
        {
Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.227
diff -u -p -r1.227 postgres.c
--- src/backend/tcop/postgres.c 2001/06/29 16:05:56     1.227
+++ src/backend/tcop/postgres.c 2001/07/12 16:34:31
@@ -1022,6 +1022,10 @@ FloatExceptionHandler(SIGNAL_ARGS)
 static void
 SigHupHandler(SIGNAL_ARGS)
 {
+#ifdef __CYGWIN__
+       elog(DEBUG, "ignoring caught SIGHUP in postgres\n");
+       return;
+#endif
        got_SIGHUP = true;
 }

Responses

pgsql-cygwin by date

Next:From: Jason TishlerDate: 2001-07-12 19:37:26
Subject: Re: compiling native libpq...
Previous:From: Christof PetigDate: 2001-07-12 09:45:37
Subject: Re: Libpq.dll on MinGW, was Re: initdb failure - postgres hangs with 100% CPU

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