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

Re: SIGTERM does not stop backend postgres processes immediately

From: Fred Yankowski <fred(at)ontosys(dot)com>
To: 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 14:40:31
Message-ID: (view raw or whole thread)
Lists: pgsql-cygwin
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.

	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 ...]

		### [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       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

In response to


pgsql-cygwin by date

Next:From: Jason TishlerDate: 2001-05-09 18:26:29
Subject: Re: SIGTERM does not stop backend postgres processes immediately
Previous:From: Jason TishlerDate: 2001-05-09 14:24:53
Subject: Re: about why build again

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