You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1996/06/13 23:34:33 UTC

Apache dieing on UNIXWARE

Did anyone have a comment on this earlier mail. Aside from my
questions about this code, I'm kind of out of it here since
I don't have access to a Unixware machine. (Thank the supreme being)




To: new-httpd@hyperreal.com
Subject: Re: WWW Form Bug Report: "stops answering http-requests within (fwd)
Date: Thu, 13 Jun 1996 09:41:36 -0500
From: Randy Terbush <ra...@zyzzyva.com>

> OK, here's netstat output from UnixWare 2.1, just before & just after
> the server stops accepting connects. It's also possible that the
> system starts logging accept() failures at 15:24. I've asked.

The only thing that looks unusual to me in this netstat output is
more FIN_WAIT2 connections than I am used to seeing. That seems
to say that the server is not getting an ACK for the close.

Since I went looking... I have to ask the question about the
following piece of code. What happens if a child fails to 
find a listener here? Do we bury them in the while() loop
for accept? It looks as if accept does not return EINTR,
we loop forever. Is there an alarm() effective here?


	accept_mutex_on();  /* Lock around "accept", if necessary */

	if (listeners != NULL)
	{
	    fd_set fds;

	    for (;;) {
		memcpy(&fds, &listenfds, sizeof(fd_set));
#ifdef HPUX
		csd = select(listenmaxfd+1, (int*)&fds, NULL, NULL, NULL);
#else
                csd = select(listenmaxfd+1, &fds, NULL, NULL, NULL);
#endif
		if (csd == -1 && errno != EINTR)
		    log_unixerr("select",NULL,"select error", server_conf);
		if (csd <= 0) continue;
		for (sd=listenmaxfd; sd >= 0; sd--)
		    if (FD_ISSET(sd, &fds)) break;
		if (sd < 0) continue;

		clen=sizeof(sa_client);
		do csd=accept(sd, &sa_client, &clen);
		while (csd == -1 && errno == EINTR);
		if (csd != -1) break;
		log_unixerr("accept", "(client socket)", NULL, server_conf);
	    }
	} else
	    while ((csd=accept(sd, &sa_client, &clen)) == -1) 
		if (errno != EINTR) 
		    log_unixerr("accept",NULL,"socket error: accept failed", server_conf);

	accept_mutex_off(); /* unlock after "accept" */