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

Balazs Scheidler bazsi@balabit.hu
Wed, 5 Sep 2001 22:42:47 +0200


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);

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1