summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-05-11 10:15:24 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-05-11 10:15:24 +0200
commitcdae37d737cae680a96dead7a322b2ee975c92a1 (patch)
tree98365444e2cbc6efd85624a23baef0c83d0dedf1 /runtime
parent831ce25230f6c8cd7c362fda3616e1233a61cf00 (diff)
downloadrsyslog-cdae37d737cae680a96dead7a322b2ee975c92a1.tar.gz
rsyslog-cdae37d737cae680a96dead7a322b2ee975c92a1.tar.xz
rsyslog-cdae37d737cae680a96dead7a322b2ee975c92a1.zip
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.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queue.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 39898718..4d94941a 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -2205,6 +2205,7 @@ qqueueEnqObj(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 */
@@ -2291,6 +2292,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 */
@@ -2314,6 +2316,7 @@ qqueueMultiEnqObj(qqueue_t *pThis, multi_submit_t *pMultiSub)
{
int iCancelStateSave;
int i;
+ rsRetVal localRet;
DEFiRet;
ISOBJ_TYPE_assert(pThis, qqueue);
@@ -2325,8 +2328,9 @@ qqueueMultiEnqObj(qqueue_t *pThis, multi_submit_t *pMultiSub)
}
for(i = 0 ; i < pMultiSub->nElem ; ++i) {
-dbgprintf("queueMultiEnq: %d\n", 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);
}
finalize_it: