It's during shutdown, so it's really not an error. However, it's easy to
use the existing endNtop value to suppress those messages and I'll patch
ntop that way.
This may be something else, where rrd is shutdown, but somehow the looping
thread didn't cancel.
The term function is pretty straight forward - kill the thread, delete the
mutex, clear the flag and exit:
static void termRRDfunct(void) {
#ifdef CFG_MULTITHREADED
if(active) killThread(&rrdThread);
#endif
#ifdef CFG_MULTITHREADED
deleteMutex(&rrdMutex);
#endif
traceEvent(CONST_TRACE_INFO, "RRD: Thanks for using the rrdPlugin");
traceEvent(CONST_TRACE_ALWAYSDISPLAY, "RRD: Done");
fflush(stdout);
initialized = 0; /* Reinit on restart */
}
However, killThread only does the detatch.
void killThread(pthread_t *threadId) {
pthread_detach(*threadId);
myGlobals.numThreads--;
}
Normally that works, because the thread recognizes it's to shutdown and does
so cleanly - so we don't put a pthread_kill() in there.
The rrdMainLoop is this:
for(;myGlobals.capturePackets != FLAG_NTOPSTATE_TERM;) {
which only stops rrd creation if the flag is actually TERM.
Inside the loop is this:
if(myGlobals.capturePackets != FLAG_NTOPSTATE_RUN) return(NULL);
So if it wakes up and we're not running, it dies.
And this, which is meant, well read the comment:
/*
* If it's FLAG_NTOPSTATE_STOPCAP, and we're still running, then this
* is the 1st pass. We just updated our data to save the counts, now
* we kill the thread...
*/
if(myGlobals.capturePackets == FLAG_NTOPSTATE_STOPCAP) {
traceEvent(CONST_TRACE_WARNING, "RRD: STOPCAP, ending rrd thread");
break;
}
}
I need to look over the whole thing. That wakeup seems wrong, and I wonder
if there shouldn't be a test on initialized - and also the STOPCAP thing -
perhaps some other way of saving the data than letting it go until the next
interval.
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of Markus Rehbach
Sent: Thursday, September 04, 2003 1:05 PM
To: [EMAIL PROTECTED]
Subject: [Ntop-dev] **ERROR** accessMutex() called 'rrd_create' with an
UN-INITIALIZED mutex
Hi all,
wanted to test the netflow plugin and therefore stopped the rrdPlugin
as fast I could reach the brower dialog for it. After a while the following
messages appeared:
04/Sep/2003 19:42:54 RRD: Thanks for using the rrdPlugin
04/Sep/2003 19:42:54 RRD: Done
04/Sep/2003 19:43:01 **ERROR** accessMutex() called 'rrd_create' with an
UN-INITIALIZED mutex [EMAIL PROTECTED]:630]
04/Sep/2003 19:43:01 **ERROR** releaseMutex() called with an UN-INITIALIZED
mutex [EMAIL PROTECTED]:653]
04/Sep/2003 19:43:01 **ERROR** accessMutex() called 'rrd_update' with an
UN-INITIALIZED mutex [EMAIL PROTECTED]:724]
04/Sep/2003 19:43:01 **ERROR** releaseMutex() called with an UN-INITIALIZED
mutex [EMAIL PROTECTED]:780]
04/Sep/2003 19:43:01 **ERROR** accessMutex() called 'rrd_create' with an
UN-INITIALIZED mutex [EMAIL PROTECTED]:630]
04/Sep/2003 19:43:01 **ERROR** releaseMutex() called with an UN-INITIALIZED
mutex [EMAIL PROTECTED]:653]
04/Sep/2003 19:43:01 **ERROR** accessMutex() called 'rrd_update' with an
UN-INITIALIZED mutex [EMAIL PROTECTED]:724]
04/Sep/2003 19:43:01 **ERROR** releaseMutex() called with an UN-INITIALIZED
mutex [EMAIL PROTECTED]:780]
.....and so on.
As far as I remember I stopped the plugin at a time where not all of the
rrds
for eth0 were created. Functionally I saw no problem.
Markus
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev