[syslog-ng]More information on time_reopen, continuous reconnects, and syslog-ng1.4.10 - 1.4.12.

matthew.copeland@honeywell.com matthew.copeland@honeywell.com
Thu, 6 Sep 2001 22:59:46 +0000 (UTC)


Okay, I must have screwed something up.  I walked through the code with a
debugger for this patch and it worked just fine this time.  Maybe when I
recompiled libol and syslog-ng after applying this patch, it didn't
compile in the new libol.  Anyhow, good work and thanks for the
help.  My next thing to check out is to see whether it will attempt to
connect again if it can't reach the server when it is first started up.  I
was noticing some problems with that, but it might be related to
this.  Thanks for all the help again.

Matthew M. Copeland




On Wed, 5 Sep 2001, Balazs Scheidler wrote:

> On Wed, Sep 05, 2001 at 08:09:06PM +0000, matthew.copeland@honeywell.com wrote:
> > -------------------------------------------------------------
> > Background reminder:
> > 	Red Hat 6.2 box acting as a remote TCP logging client
> > 	doesn't try to reconnect more than once.  Red Hat 7.1 
> > 	box acting as a remote TCP logging client attempts to
> > 	reconnect every time_reopen seconds just like it is 
> > 	supposed to do.
> > -------------------------------------------------------------
> > Well, I have spent some more time on this problem, and I have it narrowed
> > down quite a bit.
> > 
> > Using an strace of the syslog-ng client, you see the following under Red
> > Hat Linux 7.1 and Red Hat Linux 6.2.  (More details after straces)
> 
> Thanks for tracking down this issue. The problem might be the difference
> between libc/kernel versions. Earlier libcs used to emulate poll using
> select (glibc 2.0), this is not the case as strace reports it as poll. But
> Rh 6.2 and 7.1 may contain different kernel versions which behave
> differently.
> 
> The problem is that rh 6.2 returns only POLLERR without POLLHUP, and
> syslog-ng expects POLLHUP for closed sessions. This patch may fix this problem
> and create new ones, however at 22:43pm, this is the best I can make:
> 
> Index: io.c
> ===================================================================
> RCS file: /var/cvs/libol/src/io.c,v
> retrieving revision 1.25
> diff -u -r1.25 io.c
> --- io.c	2001/08/26 21:28:18	1.25
> +++ io.c	2001/09/05 20:39:02
> @@ -231,7 +231,7 @@
>  			if (!fd->super.alive)
>  				continue;
>  			
> -			if (fds[i].revents & POLLHUP) {
> +			if (fds[i].revents & (POLLHUP|POLLERR|POLLNVAL)) {
>  				if (fd->want_read && fd->read)
>  					READ_FD(fd);
>  				else if (fd->want_write && fd->write)
> @@ -246,10 +246,12 @@
>  				close_fd(fd, CLOSE_PROTOCOL_FAILURE);
>  				continue;
>  			}
> +			/*
>  			if (fds[i].revents & (POLLNVAL | POLLERR)) {
>  				close_fd(fd, CLOSE_POLL_FAILED);
>  				continue;
>  			}
> +			*/
>  			if (fds[i].revents & POLLOUT)
>  				if (fd->want_write && fd->write)
>  					WRITE_FD(fd);
> 
> 

-- 
You may be sure that when a man begins to call himself a "realist," he
is preparing to do something he is secretly ashamed of doing.
		-- Sydney Harris