diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-12-20 14:05:03 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-12-20 14:05:03 +0100 |
commit | cac0a1efdc9ce79b4503431d07075b932a6dcdb2 (patch) | |
tree | 6003183c393194b4f2090a99265d685ef6aa4b30 | |
parent | db01eab26b163362652afa7931762de1aafb4c32 (diff) | |
download | rsyslog-cac0a1efdc9ce79b4503431d07075b932a6dcdb2.tar.gz rsyslog-cac0a1efdc9ce79b4503431d07075b932a6dcdb2.tar.bz2 rsyslog-cac0a1efdc9ce79b4503431d07075b932a6dcdb2.zip |
bugfix: on termination, actions were incorrectly called
The problem was that incomplete fiter evaluation was done *during the
shutdown phase*. This affected only the LAST batches being processed. No
problem existed during the regular run. Could usually only happen on
very busy systems, which were still busy during shutdown.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | runtime/ruleset.c | 25 |
2 files changed, 23 insertions, 7 deletions
@@ -5,6 +5,11 @@ Version 7.2.5 [v7-stable] 2013-01-?? due to missing libmath. Thanks to Michael Biebl for the fix - bugfix: invalid DST handling under Solaris Thanks to Scott Severtson for the patch. +- bugfix: on termination, actions were incorrectly called + The problem was that incomplete fiter evaluation was done *during the + shutdown phase*. This affected only the LAST batches being processed. No + problem existed during the regular run. Could usually only happen on + very busy systems, which were still busy during shutdown. ---------------------------------------------------------------------------- Version 7.2.4 [v7-stable] 2012-12-07 - enhance: permit RFC3339 timestamp in local log socket messages diff --git a/runtime/ruleset.c b/runtime/ruleset.c index 3459f545..b74f8ec8 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -299,7 +299,9 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) sbool bRet; DEFiRet; newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + FINALIZE; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ if(active == NULL || active[i]) { @@ -315,13 +317,16 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) scriptExec(stmt->d.s_if.t_then, pBatch, newAct); } if(stmt->d.s_if.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) - ; ++i) + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + FINALIZE; if(pBatch->pElem[i].state != BATCH_STATE_DISC) newAct[i] = !newAct[i]; + } scriptExec(stmt->d.s_if.t_else, pBatch, newAct); } freeActive(newAct); +finalize_it: RETiRet; } @@ -334,7 +339,9 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) int bRet; int i; newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ pMsg = (msg_t*)(pBatch->pElem[i].pUsrp); @@ -355,10 +362,12 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) scriptExec(stmt->d.s_prifilt.t_then, pBatch, newAct); } if(stmt->d.s_prifilt.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) - ; ++i) + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state != BATCH_STATE_DISC) newAct[i] = !newAct[i]; + } scriptExec(stmt->d.s_prifilt.t_else, pBatch, newAct); } freeActive(newAct); @@ -461,7 +470,9 @@ execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) sbool bRet; int i; thenAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + if(*(pBatch->pbShutdownImmediate)) + return; if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ if(active == NULL || active[i]) { |