summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-19 09:41:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-19 09:41:45 +0200
commit90e8475260cf8ac54519b3d964d879489af879f6 (patch)
treecf072344f5a41b2485f6ad320c408d4f5fe0d903 /runtime
parenta4344f350151cdb9172897709fa08680ec8587ba (diff)
downloadrsyslog-90e8475260cf8ac54519b3d964d879489af879f6.tar.gz
rsyslog-90e8475260cf8ac54519b3d964d879489af879f6.tar.xz
rsyslog-90e8475260cf8ac54519b3d964d879489af879f6.zip
bugfix: message processing states were not set correctly in all cases
however, this had no negative effect, as the message processing state was not evaluated when a batch was deleted, and that was the only case where the state could be wrong.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queue.c17
-rw-r--r--runtime/queue.h6
-rw-r--r--runtime/ruleset.c2
3 files changed, 6 insertions, 19 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index dacf1f13..62fb339b 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -280,15 +280,7 @@ qqueueChkIsDA(qqueue_t *pThis)
}
-/* Start disk-assisted queue mode. All internal settings are changed. This is supposed
- * to be called from the DA worker, which must have been started before. The most important
- * chore of this function is to create the DA queue object. If that function fails,
- * the DA worker should return with an appropriate state, which in turn should lead to
- * a re-set to non-DA mode in the Enq process. The queue mutex must be locked when this
- * function is called, else a number of races will happen.
- * Please note that this function may be called *while* we in DA mode. This is due to the
- * fact that the DA worker calls it and the DA worker may be suspended (and restarted) due
- * to inactivity timeouts.
+/* Start disk-assisted queue mode.
* rgerhards, 2008-01-15
*/
static rsRetVal
@@ -354,7 +346,7 @@ finalize_it:
* rgerhards, 2008-01-16
*/
static rsRetVal
-InitDA(qqueue_t *pThis, int bEnqOnly, int bLockMutex)
+InitDA(qqueue_t *pThis, int bLockMutex)
{
DEFiRet;
DEFVARS_mutexProtection;
@@ -389,7 +381,6 @@ InitDA(qqueue_t *pThis, int bEnqOnly, int bLockMutex)
CHKiRet(StartDA(pThis));
}
- pThis->bEnqOnly = bEnqOnly; // TODO: I think this is not needed, but first clean up shutdown processing!
pThis->bRunsDA = 1;
finalize_it:
@@ -1409,6 +1400,7 @@ DeleteProcessedBatch(qqueue_t *pThis, batch_t *pBatch)
assert(pBatch != NULL);
for(i = 0 ; i < pBatch->nElem ; ++i) {
+dbgprintf("XXX: deleteProcessedBatch delete entry %d with state %d\n", i, pBatch->pElem[i].state);
pUsr = pBatch->pElem[i].pUsrp;
objDestruct(pUsr);
}
@@ -1645,7 +1637,6 @@ batchProcessed(qqueue_t *pThis, wti_t *pWti)
ISOBJ_TYPE_assert(pThis, qqueue);
ISOBJ_TYPE_assert(pWti, wti);
-dbgprintf("XXX: batchProcessed deletes %d records\n", pWti->batch.nElemDeq);
DeleteProcessedBatch(pThis, &pWti->batch);
qqueueChkPersist(pThis, pWti->batch.nElemDeq);
@@ -1882,7 +1873,7 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
/* set up DA system if we have a disk-assisted queue */
if(pThis->bIsDA)
- InitDA(pThis, QUEUE_MODE_ENQDEQ, LOCK_MUTEX); /* initiate DA mode */
+ InitDA(pThis, LOCK_MUTEX); /* initiate DA mode */
DBGOPRINT((obj_t*) pThis, "queue finished initialization\n");
diff --git a/runtime/queue.h b/runtime/queue.h
index 74bf2d31..338f091b 100644
--- a/runtime/queue.h
+++ b/runtime/queue.h
@@ -164,12 +164,6 @@ typedef struct queue_s {
} tVars;
} qqueue_t;
-/* some symbolic constants for easier reference */
-#define QUEUE_MODE_ENQDEQ 0
-#define QUEUE_MODE_ENQONLY 1
-
-#define QUEUE_IDX_DA_WORKER 0 /* index for the DA worker (fixed) */
-#define QUEUE_PTR_DA_WORKER(x) (&((pThis)->pWrkThrds[0]))
/* the define below is an "eternal" timeout for the timeout settings which require a value.
* It is one day, which is not really eternal, but comes close to it if we think about
diff --git a/runtime/ruleset.c b/runtime/ruleset.c
index 0f4bc46d..d3de672e 100644
--- a/runtime/ruleset.c
+++ b/runtime/ruleset.c
@@ -139,6 +139,7 @@ DEFFUNC_llExecFunc(processMsgDoRules)
rsRetVal iRet;
ISOBJ_TYPE_assert(pData, rule);
iRet = rule.ProcessMsg((rule_t*) pData, (msg_t*) pParam);
+dbgprintf("ruleset: get iRet %d from rule.ProcessMsg()\n", iRet);
return iRet;
}
@@ -159,6 +160,7 @@ processMsg(msg_t *pMsg)
CHKiRet(llExecFunc(&pThis->llRules, processMsgDoRules, pMsg));
finalize_it:
+dbgprintf("ruleset.ProcessMsg() returns %d\n", iRet);
RETiRet;
}