summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-05-11 10:41:52 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-05-11 10:41:52 +0200
commit28551c791bba444cdf1aef753ad15b9410d7a04a (patch)
tree102cfb96ce0d2f6ec24cbb3fd41ebc777d5cf84f
parent44dab25c55b41219dd9e865c3aac93114757f5ba (diff)
parentcdae37d737cae680a96dead7a322b2ee975c92a1 (diff)
downloadrsyslog-28551c791bba444cdf1aef753ad15b9410d7a04a.tar.gz
rsyslog-28551c791bba444cdf1aef753ad15b9410d7a04a.tar.xz
rsyslog-28551c791bba444cdf1aef753ad15b9410d7a04a.zip
Merge branch 'v4-stable' into v5-stable
Conflicts: runtime/queue.c
-rw-r--r--ChangeLog10
-rw-r--r--runtime/queue.c6
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2701559c..db5d17e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -819,6 +819,16 @@ Version 4.7.0 [v4-devel] (rgerhards), 2010-04-14
- imported changes from 4.5.6 and below
---------------------------------------------------------------------------
Version 4.6.6 [v4-stable] (rgerhards), 2010-11-??
+- bugfix: invalid processing in QUEUE_FULL condition
+ If the the multi-submit interface was used and a QUEUE_FULL condition
+ occured, the failed message was properly destructed. However, the
+ rest of the input batch, if it existed, was not processed. So this
+ lead to potential loss of messages and a memory leak. The potential
+ loss of messages was IMHO minor, because they would have been dropped
+ in most cases due to the queue remaining full, but very few lucky ones
+ from the batch may have made it. Anyhow, this has now been changed so
+ that the rest of the batch is properly tried to be enqueued and, if
+ not possible, destructed.
- bugfix: invalid storage type for config variables
- bugfix: stream driver mode was not correctly set on tcp ouput on big
endian systems.
diff --git a/runtime/queue.c b/runtime/queue.c
index 50ae307c..88e01a7a 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -2279,6 +2279,7 @@ doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr)
objDestruct(pUsr);
ABORT_FINALIZE(RS_RET_QUEUE_FULL);
}
+ dbgoprint((obj_t*) pThis, "enqueueMsg: wait solved queue full condition, enqueing\n");
}
/* and finally enqueue the message */
@@ -2306,6 +2307,7 @@ qqueueMultiEnqObjNonDirect(qqueue_t *pThis, multi_submit_t *pMultiSub)
{
int iCancelStateSave;
int i;
+ rsRetVal localRet;
DEFiRet;
ISOBJ_TYPE_assert(pThis, qqueue);
@@ -2314,7 +2316,9 @@ qqueueMultiEnqObjNonDirect(qqueue_t *pThis, multi_submit_t *pMultiSub)
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
d_pthread_mutex_lock(pThis->mut);
for(i = 0 ; i < pMultiSub->nElem ; ++i) {
- CHKiRet(doEnqSingleObj(pThis, pMultiSub->ppMsgs[i]->flowCtlType, (void*)pMultiSub->ppMsgs[i]));
+ localRet = doEnqSingleObj(pThis, pMultiSub->ppMsgs[i]->flowCtlType, (void*)pMultiSub->ppMsgs[i]);
+ if(localRet != RS_RET_OK && localRet != RS_RET_QUEUE_FULL)
+ ABORT_FINALIZE(localRet);
}
qqueueChkPersist(pThis, pMultiSub->nElem);