summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--action.c2
-rw-r--r--doc/v7compatibility.html10
-rw-r--r--grammar/rainerscript.c2
-rw-r--r--plugins/ommongodb/ommongodb.c31
-rw-r--r--runtime/ruleset.c2
6 files changed, 38 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a45ab11..f55b45ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,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
diff --git a/action.c b/action.c
index 33580f7f..ae40eadf 100644
--- a/action.c
+++ b/action.c
@@ -659,7 +659,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 692a4fe1..8834cd54 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.
+
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a> project.<br>
Copyright &copy; 2011-2012 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and
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