innfeed busy logging timer stats

Florian Schlichting fschlich at CIS.FU-Berlin.DE
Thu Jun 23 18:33:27 UTC 2011


On Wed, Jun 22, 2011 at 10:59:50PM +0200, Florian Schlichting wrote:
> Hi,
> 
> working on a development server, I noticed innfeed printing lots of
> useless lines to news.notice:
> 
> Jun 22 00:12:05 Lucia innfeed[18100]: ME time 1000 idle 1000(1) blstats 0(1) stsfile 0(0) newart 0(0) readart 0(0) prepart 0(0) read 0(1) write 0(0) 
> Jun 22 00:12:05 Lucia innfeed[18100]: ME time 0 idle 0(1) blstats 0(1) stsfile 0(0) newart 0(0) readart 0(0) prepart 0(0) read 0(0) write 0(0) 
> Jun 22 00:12:05 Lucia innfeed[18100]: ME time 0 idle 0(1) blstats 0(1) stsfile 0(0) newart 0(2) readart 0(0) prepart 0(0) read 0(1) write 0(0) 
> Jun 22 00:12:05 Lucia innfeed[18100]: ME time 0 idle 0(1) blstats 0(1) stsfile 0(0) newart 0(0) readart 0(0) prepart 0(0) read 0(1) write 0(1) 
> Jun 22 00:12:05 Lucia innfeed[18100]: ME time 0 idle 0(1) blstats 0(1) stsfile 0(0) newart 0(0) readart 0(0) prepart 0(0) read 0(0) write 0(1) 
> Jun 22 00:12:06 Lucia innfeed[18100]: ME time 1000 idle 1000(1) blstats 0(1) stsfile 0(0) newart 0(0) readart 0(0) prepart 0(0) read 0(1) write 0(0) 
> Jun 22 00:12:06 Lucia innfeed[18100]: ME time 0 idle 0(1) blstats 0(1) stsfile 0(0) newart 0(0) readart 0(0) prepart 0(0) read 0(0) write 0(0) 
> 
> The reason seems to be that TMRnow() doesn't return the current time, as
> I think innfeed assumes, but the readily usable number of milliseconds
> since the last call to TMRsummary() or TMRinit(). Patch below.

I forgot to delete a reference to last_summary, which is now unused.
Updated patch below.

Florian


---
 innfeed/endpoint.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/innfeed/endpoint.c b/innfeed/endpoint.c
index 56ae3c4..0ce1d69 100644
--- a/innfeed/endpoint.c
+++ b/innfeed/endpoint.c
@@ -586,7 +586,6 @@ void Run (void)
   fd_set rSet ;
   fd_set wSet ;
   fd_set eSet ;
-  unsigned long last_summary = 0 ;
 
   keepSelecting = 1 ;
   xsignal (SIGPIPE, pipeHandler) ;
@@ -633,17 +632,9 @@ void Run (void)
       TMRstop(TMR_IDLE);
 
       timePasses () ;
-      if (innconf->timer != 0)
-        {
-	  unsigned long now = TMRnow () ;
-	  if (last_summary == 0 
-	      || (now - last_summary) > (innconf->timer * 1000))
-	    {
-	      TMRsummary ("ME", timer_name) ;
-	      last_summary = now;
-	    }
-	}
-      
+      if (innconf->timer != 0 && TMRnow() > innconf->timer * 1000)
+          TMRsummary ("ME", timer_name);
+
       if (sval == 0 && twait == NULL)
         die ("No fd's ready and no timeouts") ;
       else if (sval < 0 && errno == EINTR)
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5557 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/inn-workers/attachments/20110623/e2583820/attachment.bin>


More information about the inn-workers mailing list