racluster ArgusRemoveFromQueue errors

VIEAU Cédric 172196 cedric.vieau at cea.fr
Wed Jun 13 07:53:33 EDT 2007


Hey Carter,

I'm using argus-client-3.rc44 on a debian amd64, and I'm having some "ArgusRemoveFromQueue() obj not in queue" errors with racluster.

I think the problem is when idle records are reported by racluster and removed from the queue (in ArgusClientTimeout), they are not removed from the hash table. So when RaProcessThisRecord finds a 'tns' in hash, it no longer exists in the queue, and trying to put the record at the end of the queue by removing/adding it fails.

Adding a call to ArgusRemoveHashEntry() seems to correct the issue (see patch below). 

Regarding the same section of the code, I have another issue with racluster.
When reading flows from a radium (with -S flag), idle records are almost never reported. I found that most of the time, 'nslt' is greater than 'glt', 
so ((glt - nslt) >= agg->idleint) is always false. 
Any idea why ArgusFetchLastTime(ns) would report a timestamp greater than the current ArgusGlobalTime ?

My workaround (when Sflag is used) is to use the queue timestamp to compute idle time :
 if (ArgusParser->Sflag)
   nslt  = (double)(ns->qhdr.lasttime.tv_sec * 1.0) + (double)(ns->qhdr.lasttime.tv_usec/1000000.0);
It works for me, but it's certainly not a good solution...
    
thanks,
Cedric

--- argus-clients-3.0.0.rc.44.orig/clients/racluster.c  2007-06-08 16:32:23.000000000 +0200
+++ argus-clients-3.0.0.rc.44/clients/racluster.c       2007-06-13 11:48:52.000000000 +0200
@@ -241,10 +241,11 @@
       while (!done) {
          if (agg->queue->start) {
             struct ArgusRecordStruct *ns = (struct ArgusRecordStruct *) agg->queue->start;
             double nslt = ArgusFetchLastTime(ns);
             double glt  = (double)(ArgusParser->ArgusGlobalTime.tv_sec * 1.0) + (double)(ArgusParser->ArgusGlobalTime.tv_usec/1000000.0);
 
             if (agg->idleint && ((glt - nslt) >= agg->idleint)) {
+               ArgusRemoveHashEntry(ns->htblhdr);
                ArgusRemoveFromQueue(agg->queue, &ns->qhdr, ARGUS_NOLOCK);
                RaSendArgusRecord(ns);
                ArgusDeleteRecordStruct (ArgusParser, ns);



More information about the argus mailing list