This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Cygwin CVS (or 1.1.8) fixes PostgreSQL postmaster shutdown problem


PostgreSQL running on 1.1.7 (and earlier) had a minor (but annoying)
postmaster shutdown problem.  If more than one client connected
concurrently to postmaster (i.e., the PostgreSQL backend), then
the postmaster process would not shutdown cleanly.  By "cleanly," I
mean that it would take a random number of "kill -s SIGTERM" attempts
before postmaster would terminate.  Further, the greater the number of
concurrent clients the greater the number of kills before postmaster
would finally exit.

I have been working with Yutaka tanida off and on to try to get to the
bottom of this problem.  See attached for his latest attempt.

Magically the problem seems to be solved in the latest Cygwin CVS.  Did
someone commit a patch that would correct this problem?

Thanks,
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: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com


Jason,

> On Mon, Jan 15, 2001 at 11:42:13PM +0900, Yutaka tanida wrote:
> > > > Sorry , I have a mistake.
> > > I'm not sure that I understand your above comment.  Does it mean that your
> > > patch has a mistake in it?
> > 
> > Oh, my mistake is that attached patch can'tfix this problem. It fixes
> > some problem on PostgreSQL , but can't fix it.
> 
> Are you still attempting to fix this problem?  Please do not interpret
> this as a request.  I will understand if you do not want or have time to
> continue with this effort.  I just need to know whether or not I should
> start to debug myself.

Today, I'm working on this and finally create a patch against cygwin
1.1.7 . This patch fixes PostgreSQL's problem , but attatched C program
doesn't work correctly.


---
Yutaka tanida<yutaka@hi-net.zaq.ne.jp>


---- testsig.c


#include<signal.h>
#include<unistd.h>
#include<stdio.h>
#include<errno.h>



void recvsig(int);
static sigset_t unblock,block,old;

int main() {
	int pid=getpid();
	int pid2=-1;
	int i=0,k=0;
	char buffer[8];

	signal(SIGUSR1,recvsig);
	signal(SIGUSR2,recvsig);
	sigfillset(&block);
	sigemptyset(&unblock);
	sigprocmask(SIG_SETMASK,&block,&old);
	for(k=0;k<10;k++) {
		kill(pid,SIGUSR1);
	}
	sleep(2);
    for(i=0;i<10;i++) {
	  sigprocmask(SIG_SETMASK,&unblock,&old);
	  sleep(0);
	  	  kill(pid,SIGUSR2); //comment this!
	}
}

void recvsig(int sig) {
	switch(sig) {

	case SIGUSR1:
	  printf("SIGUSR1\n");
	  break;
	case SIGUSR2:
	  printf("SIGUSR2\n");
	  break;
	default:
	  printf("UNKNOWN\n");
	  break;
	}
	usleep(100000);
}

signalfix.diff




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]