summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-06-01 16:51:03 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-06-01 16:51:03 +0200
commit4a37e5daba6ede7c8c486c14a3403d495d21c697 (patch)
treeaddd96ca550f31b9f5f0d17b558f91a79c94a881
parent00ce927aa99e40cd8a917963f7c7d7ea6785f118 (diff)
parentd6602c1a6cfd48ff1f5b7656eb429d60ce927ebc (diff)
downloadrsyslog-4a37e5daba6ede7c8c486c14a3403d495d21c697.tar.gz
rsyslog-4a37e5daba6ede7c8c486c14a3403d495d21c697.tar.xz
rsyslog-4a37e5daba6ede7c8c486c14a3403d495d21c697.zip
Merge branch 'v5-beta' into beta
-rw-r--r--ChangeLog14
-rw-r--r--action.c2
-rw-r--r--runtime/queue.c26
-rw-r--r--tools/syslogd.c4
4 files changed, 33 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 985287da..2e9b8348 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -454,6 +454,13 @@ expected that interfaces, even new ones, break during the initial
[ported from v4]
---------------------------------------------------------------------------
Version 5.9.8 [V5-BETA], 2012-05-??
+- bugfix: delayble source could block action queue, even if there was
+ a disk queue associated with it. The root cause of this problem was
+ that it makes no sense to delay messages once they arrive in the
+ action queue - the "input" that is being held in that case is the main
+ queue worker, what makes no sense.
+ Thanks to Marcin for alerting us on this problem and providing
+ instructions to reproduce it.
- bugfix: disk queue was not persisted on shutdown, regression of fix to
http://bugzilla.adiscon.com/show_bug.cgi?id=299
The new code also handles the case of shutdown of blocking light and
@@ -611,6 +618,13 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-06-08
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236
---------------------------------------------------------------------------
Version 5.8.12 [V5-stable] 2012-05-??
+- bugfix: delayble source could block action queue, even if there was
+ a disk queue associated with it. The root cause of this problem was
+ that it makes no sense to delay messages once they arrive in the
+ action queue - the "input" that is being held in that case is the main
+ queue worker, what makes no sense.
+ Thanks to Marcin for alerting us on this problem and providing
+ instructions to reproduce it.
- bugfix: disk queue was not persisted on shutdown, regression of fix to
http://bugzilla.adiscon.com/show_bug.cgi?id=299
The new code also handles the case of shutdown of blocking light and
diff --git a/action.c b/action.c
index 91399f49..bcefe9e9 100644
--- a/action.c
+++ b/action.c
@@ -1350,7 +1350,7 @@ doSubmitToActionQ(action_t *pAction, msg_t *pMsg)
if(pAction->pQueue->qType == QUEUETYPE_DIRECT)
iRet = qqueueEnqObjDirect(pAction->pQueue, (void*) MsgAddRef(pMsg));
else
- iRet = qqueueEnqObj(pAction->pQueue, pMsg->flowCtlType, (void*) MsgAddRef(pMsg));
+ iRet = qqueueEnqObj(pAction->pQueue, eFLOWCTL_NO_DELAY, (void*) MsgAddRef(pMsg));
RETiRet;
}
diff --git a/runtime/queue.c b/runtime/queue.c
index 2b017747..a2f80d29 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -2462,21 +2462,27 @@ doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr)
while( (pThis->iMaxQueueSize > 0 && pThis->iQueueSize >= pThis->iMaxQueueSize)
|| (pThis->qType == QUEUETYPE_DISK && pThis->sizeOnDiskMax != 0
&& pThis->tVars.disk.sizeOnDisk > pThis->sizeOnDiskMax)) {
- DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL - waiting to drain.\n");
- if(glbl.GetGlobalInputTermState()) {
- DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL, discard due to FORCE_TERM.\n");
- ABORT_FINALIZE(RS_RET_FORCE_TERM);
- }
- timeoutComp(&t, pThis->toEnq);
STATSCOUNTER_INC(pThis->ctrFull, pThis->mutCtrFull);
-// TODO : handle enqOnly => discard!
- if(pthread_cond_timedwait(&pThis->notFull, pThis->mut, &t) != 0) {
- DBGOPRINT((obj_t*) pThis, "enqueueMsg: cond timeout, dropping message!\n");
+ if(pThis->toEnq == 0 || pThis->bEnqOnly) {
+ DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL - configured for immediate discarding.\n");
STATSCOUNTER_INC(pThis->ctrFDscrd, pThis->mutCtrFDscrd);
objDestruct(pUsr);
ABORT_FINALIZE(RS_RET_QUEUE_FULL);
- }
+ } else {
+ DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL - waiting %dms to drain.\n", pThis->toEnq);
+ if(glbl.GetGlobalInputTermState()) {
+ DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL, discard due to FORCE_TERM.\n");
+ ABORT_FINALIZE(RS_RET_FORCE_TERM);
+ }
+ timeoutComp(&t, pThis->toEnq);
+ if(pthread_cond_timedwait(&pThis->notFull, pThis->mut, &t) != 0) {
+ DBGOPRINT((obj_t*) pThis, "enqueueMsg: cond timeout, dropping message!\n");
+ STATSCOUNTER_INC(pThis->ctrFDscrd, pThis->mutCtrFDscrd);
+ 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 */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 7d995cc2..8bcb3aa6 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1663,7 +1663,7 @@ doGlblProcessInit(void)
if( !(Debug == DEBUG_FULL || NoFork) )
{
- DBGPRINTF("Checking pidfile.\n");
+ DBGPRINTF("Checking pidfile '%s'.\n", PidFile);
if (!check_pid(PidFile))
{
memset(&sigAct, 0, sizeof (sigAct));
@@ -1736,7 +1736,7 @@ doGlblProcessInit(void)
}
/* tuck my process id away */
- DBGPRINTF("Writing pidfile %s.\n", PidFile);
+ DBGPRINTF("Writing pidfile '%s'.\n", PidFile);
if (!check_pid(PidFile))
{
if (!write_pid(PidFile))