Re: [syslog-ng]More information on time_reopen, continuous reconnects, and syslog-ng 1.4.12.
I think that part of the problem with this patch is that fd->super.alive doesn't get set to zero. I could be wrong, but I traced through the original code using gdb and then I received your patch. So after trying the patch and finding that it didn't work, I went back and looked at the output of the script file. The first time the socket times out, fd->super.alive gets set to 0 and the second poll doesn't happen. Then, when you go into the for loop if continues back fd->super.alive is zero. If this is the setup to get it to setup the callback for reconnecting later, maybe we should do the POLLERR check when we do the fd->super.alive check, and set fd->super.alive = 0 if we get into that if statement. What do you think? I have included the script output session of my walk through the code using gdb. (compressed this time.) Matthew M. Copeland
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
participants (1)
-
matthew.copeland@honeywell.com