Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-Authentication-Warning: shell-1.enteract.com: fcy set sender to fred AT ontosys DOT com using -f Date: Wed, 9 May 2001 09:40:31 -0500 From: Fred Yankowski To: pgsql-cygwin AT postgresql DOT org, cygwin AT cygwin DOT com Subject: Re: SIGTERM does not stop backend postgres processes immediately Message-ID: <20010509094031.A87424@enteract.com> References: <20010508142427 DOT A25541 AT enteract DOT com> <20010508220519 DOT A1707 AT dothill DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010508220519.A1707@dothill.com>; from Jason.Tishler@dothill.com on Tue, May 08, 2001 at 10:05:19PM -0400 I just ran 'make check' for postgres and all 76 tests passed. 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. 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. Here's a scenario. BASH WINDOW 1 | BASH WINDOW 2 | | BASH WINDOW 3 v v v postmaster -i -D /usr/local/pgsql/data.test/ -d 1 ### database comes up to "production state" psql -h localhost template1 ### starts up OK and prompts for a command ps -ef ### 2 postgres processes (one is actually the ### postmaster) and 1 psql process pg_ctl -D /usr/local/pgsql/data.test/ -m fast stop ### reports "waiting" and many dots ### "Fast Shutdown request" message appears ### times out and reports "failed" [nothing more happens (which is the problem to be solved) until I do ...] \d ### [Any command to the backend would do.] ### "connection terminated" message appears ### "database system is shut down" appears. ps -ef ### the postgres processes are gone. 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. 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". ;-) Anyway, "make check" completes without any errors. No apparent hangs. -- 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 -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple