summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--runtime/queue.c8
2 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b8cbdb42..4511dbef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+- 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.
- added imptcp, a simplified, Linux-specific and potentielly fast
syslog plain tcp input plugin (NOT supporting TLS!)
---------------------------------------------------------------------------
diff --git a/runtime/queue.c b/runtime/queue.c
index 9d7a9058..53d15a73 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -2206,6 +2206,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 */
@@ -2292,6 +2293,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 */
@@ -2315,6 +2317,7 @@ qqueueMultiEnqObj(qqueue_t *pThis, multi_submit_t *pMultiSub)
{
int iCancelStateSave;
int i;
+ rsRetVal localRet;
DEFiRet;
ISOBJ_TYPE_assert(pThis, qqueue);
@@ -2326,8 +2329,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: