INN commit: trunk (doc/pod/news.pod innd/chan.c)

INN Commit rra at isc.org
Mon May 20 16:33:26 UTC 2013


    Date: Monday, May 20, 2013 @ 09:33:26
  Author: iulius
Revision: 9469

fixed the occurrence of an unexpected "cant select" error generated by innd

errno was not preserved; the status hook was stuck between the select and
the check of its return status, so we're getting a spurious EPERM from
STATUSsummary, probably from some random glibc internal syscall involved
in fopen() that isn't actually important.

It only happens twice since it can only happen when select is interrupted
by a signal (triggering EINTR, which then gets overwritten with EPERM),
which is probably due to child processes completing, which is probably
only happening during specific events on your server during expire.

The solution is to rewrite this code to the order that it should have been
written in the first place.

Thanks to Paul Tomblin for having caught that long-standing issue.

Modified:
  trunk/doc/pod/news.pod
  trunk/innd/chan.c

------------------+
 doc/pod/news.pod |    6 ++++++
 innd/chan.c      |   13 +++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2013-04-14 16:35:54 UTC (rev 9468)
+++ doc/pod/news.pod	2013-05-20 16:33:26 UTC (rev 9469)
@@ -129,6 +129,12 @@
 which is in particular the command invoked by B<scanlogs> to rotate
 log files.
 
+=item *
+
+Fixed the occurrence of an unexpected C<cant select> error generated by
+B<innd>.  Thanks to Paul Tomblin for having caught that long-standing
+issue.
+
 =back
 
 =head1 Changes in 2.5.3

Modified: innd/chan.c
===================================================================
--- innd/chan.c	2013-04-14 16:35:54 UTC (rev 9468)
+++ innd/chan.c	2013-05-20 16:33:26 UTC (rev 9469)
@@ -1168,21 +1168,22 @@
         count = select(channels.max_fd + 1, &rdfds, &wrfds, NULL, &tv);
         TMRstop(TMR_IDLE);
 
-        STATUSmainloophook();
-        if (GotTerminate) {
-            warn("%s exiting due to signal", LogName);
-            CleanupAndExit(0, NULL);
-        }
         if (count < 0) {
             if (errno != EINTR) {
                 syswarn("%s cant select", LogName);
 #ifdef INND_FIND_BAD_FDS
                 CHANdiagnose();
-#endif
+#endif      
             }
             continue;
         }
 
+        STATUSmainloophook();
+        if (GotTerminate) {
+            warn("%s exiting due to signal", LogName);
+            CleanupAndExit(0, NULL);
+        }
+
         /* Update the "reasonably accurate" time. */
         gettimeofday(&Now, NULL);
         if (Now.tv_sec > last_sync + TimeOut.tv_sec) {



More information about the inn-committers mailing list