summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-03-12 17:03:51 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-03-12 17:03:51 +0100
commit0b5fe246b55635d8eaf3182ddad8961c7d3757c2 (patch)
tree2e9c645db556827d616410833a01e448358aa3fd /runtime
parent2f8cd1aba769c536cebdebc26c20b9a6b1b00fad (diff)
parent16cc84fc699fc3f830b0c28d677d6ae0daa35723 (diff)
downloadrsyslog-0b5fe246b55635d8eaf3182ddad8961c7d3757c2.tar.gz
rsyslog-0b5fe246b55635d8eaf3182ddad8961c7d3757c2.tar.xz
rsyslog-0b5fe246b55635d8eaf3182ddad8961c7d3757c2.zip
Merge branch 'v5-stable' into v6-stable
Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queue.c9
-rw-r--r--runtime/wti.c2
-rw-r--r--runtime/wtp.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 9012abeb..5b25fcf7 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1787,7 +1787,8 @@ qqueueChkStopWrkrDA(qqueue_t *pThis)
{
DEFiRet;
-//DBGPRINTF("XXXX: chkStopWrkrDA called, low watermark %d, phys Size %d\n", pThis->iLowWtrMrk, getPhysicalQueueSize(pThis));
+ /*DBGPRINTF("XXXX: chkStopWrkrDA called, low watermark %d, log Size %d, phys Size %d, bEnqOnly %d\n",
+ pThis->iLowWtrMrk, getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis), pThis->bEnqOnly);*/
if(pThis->bEnqOnly) {
iRet = RS_RET_TERMINATE_WHEN_IDLE;
}
@@ -1808,6 +1809,8 @@ static rsRetVal
ChkStopWrkrReg(qqueue_t *pThis)
{
DEFiRet;
+ /*DBGPRINTF("XXXX: chkStopWrkrReg called, low watermark %d, log Size %d, phys Size %d, bEnqOnly %d\n",
+ pThis->iLowWtrMrk, getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis), pThis->bEnqOnly);*/
if(pThis->bEnqOnly) {
iRet = RS_RET_TERMINATE_NOW;
} else if(pThis->pqParent != NULL) {
@@ -1844,6 +1847,7 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
int wrk;
uchar *qName;
size_t lenBuf;
+ int iQueueSizeSave;
ASSERT(pThis != NULL);
@@ -1925,8 +1929,11 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
qName = obj.GetName((obj_t*)pThis);
CHKiRet(statsobj.Construct(&pThis->statsobj));
CHKiRet(statsobj.SetName(pThis->statsobj, qName));
+ /* we need to save the queue size, as the stats module initializes it to 0! */
+ iQueueSizeSave = pThis->iQueueSize;
CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("size"),
ctrType_Int, &pThis->iQueueSize));
+ pThis->iQueueSize = iQueueSizeSave;
STATSCOUNTER_INIT(pThis->ctrEnqueued, pThis->mutCtrEnqueued);
CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("enqueued"),
diff --git a/runtime/wti.c b/runtime/wti.c
index 0b85c366..69da2e9f 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -315,6 +315,8 @@ wtiWorker(wti_t *pThis)
if(localRet == RS_RET_IDLE) {
if(terminateRet == RS_RET_TERMINATE_WHEN_IDLE || bInactivityTOOccured) {
d_pthread_mutex_unlock(pWtp->pmutUsr);
+ dbgoprint((obj_t*) pThis, "terminating worker terminateRet=%d, bInactivityTOOccured=%d\n",
+ terminateRet, bInactivityTOOccured);
break; /* end of loop */
}
doIdleProcessing(pThis, pWtp, &bInactivityTOOccured);
diff --git a/runtime/wtp.c b/runtime/wtp.c
index e615fb19..a53a9888 100644
--- a/runtime/wtp.c
+++ b/runtime/wtp.c
@@ -309,7 +309,7 @@ wtpWrkrExecCleanup(wti_t *pWti)
wtiSetState(pWti, WRKTHRD_STOPPED);
ATOMIC_DEC(&pThis->iCurNumWrkThrd, &pThis->mutCurNumWrkThrd);
- DBGPRINTF("%s: Worker thread %lx, terminated, um workers now %d\n",
+ DBGPRINTF("%s: Worker thread %lx, terminated, num workers now %d\n",
wtpGetDbgHdr(pThis), (unsigned long) pWti,
ATOMIC_FETCH_32BIT(&pThis->iCurNumWrkThrd, &pThis->mutCurNumWrkThrd));