summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-08-31 11:18:03 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-08-31 11:18:03 +0200
commite14098e89f61f6d5927f90c96cc9a1b249ac728a (patch)
tree395d3f8d3a0d2e307a2f38e3080dcdd2f9bbec61 /action.c
parentf58dd9c146d227758bcc065639c31995c6c23800 (diff)
parenta4745f2afac60c28be53088050e9481b30926361 (diff)
downloadrsyslog-e14098e89f61f6d5927f90c96cc9a1b249ac728a.tar.gz
rsyslog-e14098e89f61f6d5927f90c96cc9a1b249ac728a.tar.xz
rsyslog-e14098e89f61f6d5927f90c96cc9a1b249ac728a.zip
Merge branch 'v5-stable' into v5-devel
Diffstat (limited to 'action.c')
-rw-r--r--action.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/action.c b/action.c
index dfac8d4f..d8498739 100644
--- a/action.c
+++ b/action.c
@@ -965,7 +965,7 @@ tryDoAction(action_t *pAction, batch_t *pBatch, int *pnElem)
i = pBatch->iDoneUpTo; /* all messages below that index are processed */
iElemProcessed = 0;
iCommittedUpTo = i;
-dbgprintf("XXXXX: tryDoAction %p, pnElem %d, nElem %d\n", pAction, *pnElem, pBatch->nElem);
+dbgprintf("XXXXX: tryDoAction %p, pnElem %d, nElem %d\n", pAction, *pnElem, pBatch->nElem);
while(iElemProcessed <= *pnElem && i < pBatch->nElem) {
if(*(pBatch->pbShutdownImmediate))
ABORT_FINALIZE(RS_RET_FORCE_TERM);
@@ -1486,7 +1486,6 @@ doSubmitToActionQNotAllMarkBatch(action_t *pAction, batch_t *pBatch)
time_t now = 0;
time_t lastAct;
int i;
- int bProcessMarkMsgs = 0;
int bModifiedFilter;
sbool FilterSave[1024];
sbool *pFilterSave;
@@ -1500,33 +1499,32 @@ doSubmitToActionQNotAllMarkBatch(action_t *pAction, batch_t *pBatch)
bModifiedFilter = 0;
for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(!pBatch->pElem[i].bFilterOK)
+ continue;
pFilterSave[i] = pBatch->pElem[i].bFilterOK;
- if(((msg_t*)(pBatch->pElem[i].pUsrp))->msgFlags & MARK) {
- /* check if we need to write or not */
- if(now == 0) {
- now = datetime.GetTime(NULL); /* good time call - the only one done */
- /* CAS loop, we write back a bit early, but that's OK... */
- /* we use reception time, not dequeue time - this is considered more appropriate and
- * also faster ;) -- rgerhards, 2008-09-17 */
- do {
- lastAct = pAction->f_time;
- if((now - lastAct) < MarkInterval / 2) {
- DBGPRINTF("action was recently called, ignoring mark message\n");
- bProcessMarkMsgs = 0;
- } else {
- bProcessMarkMsgs = 1;
- }
- } while(ATOMIC_CAS_time_t(&pAction->f_time, lastAct,
- ((msg_t*)(pBatch->pElem[i].pUsrp))->ttGenTime, &pAction->mutCAS) == 0);
- }
- if(bProcessMarkMsgs) {
- pBatch->pElem[i].bFilterOK = 0;
- bModifiedFilter = 1;
+ if(now == 0) {
+ now = datetime.GetTime(NULL); /* good time call - the only one done */
+ }
+ /* CAS loop, we write back a bit early, but that's OK... */
+ /* we use reception time, not dequeue time - this is considered more appropriate and
+ * also faster ;) -- rgerhards, 2008-09-17 */
+ do {
+ lastAct = pAction->f_time;
+ if(((msg_t*)(pBatch->pElem[i].pUsrp))->msgFlags & MARK) {
+ if((now - lastAct) < MarkInterval / 2) {
+ pBatch->pElem[i].bFilterOK = 0;
+ bModifiedFilter = 1;
+ DBGPRINTF("action was recently called, ignoring mark message\n");
+ break; /* do not update timestamp for non-written mark messages */
+ }
}
+ } while(ATOMIC_CAS_time_t(&pAction->f_time, lastAct,
+ ((msg_t*)(pBatch->pElem[i].pUsrp))->ttGenTime, &pAction->mutCAS) == 0);
+ if(pBatch->pElem[i].bFilterOK) {
+ DBGPRINTF("Called action(NotAllMark), processing batch[%d] via '%s'\n",
+ i, module.GetStateName(pAction->pMod));
}
}
-
- DBGPRINTF("Called action(NotAllMark), logging to %s\n", module.GetStateName(pAction->pMod));
iRet = doSubmitToActionQBatch(pAction, pBatch);