diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | action.c | 2 | ||||
-rw-r--r-- | doc/v7compatibility.html | 10 | ||||
-rw-r--r-- | grammar/rainerscript.c | 2 | ||||
-rw-r--r-- | plugins/ommongodb/ommongodb.c | 31 | ||||
-rw-r--r-- | runtime/ruleset.c | 2 | ||||
-rw-r--r-- | runtime/stream.c | 2 |
7 files changed, 38 insertions, 19 deletions
@@ -34,6 +34,14 @@ Version 7.3.0 [devel] 2012-10-09 This was achieved by somewhat reducing the robustness of the zip archive. This is controlled by the new action parameter "VeryReliableZip". ---------------------------------------------------------------------------- +Version 7.2.1 [v7-stable] 2012-10-?? +- the rsyslog core now suspeneds actions after 10 failures in a row + This was former the case after 1,000 failures and could cause rsyslog + to be spammed/ressources misused. See the v6 compatibility doc for more + details. +- ommongodb rate-limits error messages to prevent spamming the syslog + closes (for v7.2): http://bugzilla.adiscon.com/show_bug.cgi?id=366 +---------------------------------------------------------------------------- Version 7.2.0 [v7-stable] 2012-10-22 This starts a new stable branch based on 7.1.12 plus the following changes: - bugfix: imuxsock did not properly honor $LocalHostIPIF @@ -651,7 +651,7 @@ actionDoRetry(action_t *pThis, time_t ttNow, int *pbShutdownImmediate) iRetries = 0; while((*pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) { iRet = pThis->pMod->tryResume(pThis->pModData); - if((pThis->iResumeOKinRow > 999) && (pThis->iResumeOKinRow % 1000 == 0)) { + if((pThis->iResumeOKinRow > 9) && (pThis->iResumeOKinRow % 10 == 0)) { bTreatOKasSusp = 1; pThis->iResumeOKinRow = 0; } else { diff --git a/doc/v7compatibility.html b/doc/v7compatibility.html index 932e2076..24c17d72 100644 --- a/doc/v7compatibility.html +++ b/doc/v7compatibility.html @@ -42,6 +42,16 @@ They tell that the construct is deprecated and which statement is to be used as replacement. This does <b>not</b> affect operations: both modules are still fully operational and will not be removed in the v7 timeframe. +<h2>Retries of output plugins that do not do proper replies</h2> +<p>Some output plugins may not be able to detect if their target is capable of +accepting data again after an error (technically, they always return OK when +TryResume is called). Previously, the rsyslog core engine suspended such an action +after 1000 succesive failures. This lead to potentially a large amount of +errors and error messages. Starting with 7.2.1, this has been reduced to 10 +successive failures. This still gives the plugin a chance to recover. In extreme +cases, a plugin may now enter suspend mode where it previously did not do so. +In practice, we do NOT expect that. +<h1>Notes for the 7.3/7.4 branch</h1> <h2>"last message repeated n times" Processing</h2> <p>This processing has been optimized and moved to the input side. This results in usually far better performance and also de-couples different sources diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 9483e116..733ebef4 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2458,7 +2458,7 @@ cnfstmtOptimizeAct(struct cnfstmt *stmt) action_t *pAct; pAct = stmt->d.act; - if(!strcmp((char*)modGetName(stmt->d.act->pMod), "builtin:omdiscard")) { + if(!strcmp((char*)modGetName(pAct->pMod), "builtin:omdiscard")) { DBGPRINTF("optimizer: replacing omdiscard by STOP\n"); actionDestruct(stmt->d.act); stmt->nodetype = S_STOP; diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c index 57ef20b2..acc40ab7 100644 --- a/plugins/ommongodb/ommongodb.c +++ b/plugins/ommongodb/ommongodb.c @@ -68,6 +68,7 @@ typedef struct _instanceData { uchar *pwd; uchar *dbNcoll; uchar *tplName; + int bErrMsgPermitted; /* only one errmsg permitted per connection */ } instanceData; @@ -139,19 +140,21 @@ static void reportMongoError(instanceData *pData) { char errStr[1024]; - errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", - rs_strerror_r(errno, errStr, sizeof(errStr))); -#if 0 gchar *err; - if(mongo_sync_cmd_get_last_error(pData->conn, (gchar*)pData->db, &err) == TRUE) { - errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", err); - } else { - errmsg.LogError(0, RS_RET_ERR, "ommongodb: we had an error, but can " - "not obtain specifics"); + int eno; + + if(pData->bErrMsgPermitted) { + eno = errno; + if(mongo_sync_cmd_get_last_error(pData->conn, (gchar*)pData->db, &err) == TRUE) { + errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", err); + } else { + DBGPRINTF("ommongodb: we had an error, but can not obtain specifics, " + "using plain old errno error message generator\n"); + errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", + rs_strerror_r(eno, errStr, sizeof(errStr))); + } + pData->bErrMsgPermitted = 0; } -#else - (void)pData; -#endif } @@ -433,9 +436,11 @@ CODESTARTdoAction /* FIXME: is this a correct return code? */ ABORT_FINALIZE(RS_RET_ERR); } - if(!mongo_sync_cmd_insert(pData->conn, (char*)pData->dbNcoll, doc, NULL)) { - reportMongoError(pData); + if(mongo_sync_cmd_insert(pData->conn, (char*)pData->dbNcoll, doc, NULL)) { + pData->bErrMsgPermitted = 1; + } else { dbgprintf("ommongodb: insert error\n"); + reportMongoError(pData); ABORT_FINALIZE(RS_RET_SUSPENDED); } diff --git a/runtime/ruleset.c b/runtime/ruleset.c index d2c21424..24d8279c 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -459,14 +459,12 @@ static void execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) { sbool *thenAct; - msg_t *pMsg; sbool bRet; int i; thenAct = newActive(pBatch); for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { if(pBatch->pElem[i].state == BATCH_STATE_DISC) continue; /* will be ignored in any case */ - pMsg = (msg_t*)(pBatch->pElem[i].pUsrp); if(active == NULL || active[i]) { bRet = evalPROPFILT(stmt, (msg_t*)(pBatch->pElem[i].pUsrp)); } else diff --git a/runtime/stream.c b/runtime/stream.c index 064cb42a..aee4d2ad 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -1175,7 +1175,6 @@ static rsRetVal doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush) { int zRet; /* zlib return state */ - sbool bzInitDone = RSFALSE; DEFiRet; unsigned outavail; assert(pThis != NULL); @@ -1194,7 +1193,6 @@ doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush) } pThis->bzInitDone = RSTRUE; } - bzInitDone = RSTRUE; /* now doing the compression */ pThis->zstrm.next_in = (Bytef*) pBuf; |