From 121f5ab4ec4e766aeae5671005325a6aef4a1806 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Fri, 11 Feb 2011 14:56:02 +0100
Subject: bugfix: queue engine did not properly slow down inputs in FULL_DELAY
mode...
...when in disk-assisted mode. This especially affected imfile, which
created unnecessarily queue files if a large set of input file data was
to process.
---
ChangeLog | 4 ++++
runtime/queue.c | 13 ++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 57c23cd5..6e34a436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@ Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-??
- bugfix: abort if imfile reads file line of more than 64KiB
Thanks to Peter Eisentraut for reporting and analysing this problem.
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221
+- bugfix: queue engine did not properly slow down inputs in FULL_DELAY mode
+ when in disk-assisted mode. This especially affected imfile, which
+ created unnecessarily queue files if a large set of input file data was
+ to process.
---------------------------------------------------------------------------
Version 5.7.3 [V5-BETA] (rgerhards), 2011-02-07
- added support for processing multi-line messages in imfile
diff --git a/runtime/queue.c b/runtime/queue.c
index e4922f37..cc7c0f54 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -246,6 +246,7 @@ qqueueAdviseMaxWorkers(qqueue_t *pThis)
if(!pThis->bEnqOnly) {
if(pThis->bIsDA && getLogicalQueueSize(pThis) >= pThis->iHighWtrMrk) {
+ DBGOPRINT((obj_t*) pThis, "(re)activating DA worker\n");
wtpAdviseMaxWorkers(pThis->pWtpDA, 1); /* disk queues have always one worker */
} else {
if(getLogicalQueueSize(pThis) == 0) {
@@ -1211,7 +1212,6 @@ rsRetVal qqueueConstruct(qqueue_t **ppThis, queueType_t qType, int iWorkerThread
/* set some water marks so that we have useful defaults if none are set specifically */
pThis->iFullDlyMrk = iMaxQueueSize - (iMaxQueueSize / 100) * 3; /* default 97% */
pThis->iLightDlyMrk = iMaxQueueSize - (iMaxQueueSize / 100) * 30; /* default 70% */
-
pThis->lenSpoolDir = ustrlen(pThis->pszSpoolDir);
pThis->iMaxFileSize = 1024 * 1024; /* default is 1 MiB */
pThis->iQueueSize = 0;
@@ -1819,6 +1819,7 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
{
DEFiRet;
uchar pszBuf[64];
+ int wrk;
uchar *qName;
size_t lenBuf;
@@ -1850,6 +1851,16 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
/* call type-specific constructor */
CHKiRet(pThis->qConstruct(pThis)); /* this also sets bIsDA */
+ /* re-adjust some params if required */
+ if(pThis->bIsDA) {
+ /* if we are in DA mode, we must make sure full delayable messages do not
+ * initiate going to disk!
+ */
+ wrk = pThis->iHighWtrMrk - (pThis->iHighWtrMrk / 100) * 50; /* 50% of high water mark */
+ if(wrk < pThis->iFullDlyMrk)
+ pThis->iFullDlyMrk = wrk;
+ }
+
DBGOPRINT((obj_t*) pThis, "type %d, enq-only %d, disk assisted %d, maxFileSz %lld, lqsize %d, pqsize %d, child %d, "
"full delay %d, light delay %d, deq batch size %d starting\n",
pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->iMaxFileSize,
--
cgit v1.2.3
From 6a18d25cbec2676a7910ff038170716293abe89f Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Fri, 11 Feb 2011 17:06:20 +0100
Subject: removed no longer needed code
---
runtime/queue.c | 2 --
runtime/queue.h | 1 -
2 files changed, 3 deletions(-)
diff --git a/runtime/queue.c b/runtime/queue.c
index cc7c0f54..9f63a338 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1842,7 +1842,6 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
}
pthread_mutex_init(&pThis->mutThrdMgmt, NULL);
- pthread_cond_init (&pThis->condDAReady, NULL);
pthread_cond_init (&pThis->notFull, NULL);
pthread_cond_init (&pThis->notEmpty, NULL);
pthread_cond_init (&pThis->belowFullDlyWtrMrk, NULL);
@@ -2140,7 +2139,6 @@ CODESTARTobjDestruct(qqueue)
free(pThis->mut);
}
pthread_mutex_destroy(&pThis->mutThrdMgmt);
- pthread_cond_destroy(&pThis->condDAReady);
pthread_cond_destroy(&pThis->notFull);
pthread_cond_destroy(&pThis->notEmpty);
pthread_cond_destroy(&pThis->belowFullDlyWtrMrk);
diff --git a/runtime/queue.h b/runtime/queue.h
index 38e248cd..97057180 100644
--- a/runtime/queue.h
+++ b/runtime/queue.h
@@ -124,7 +124,6 @@ struct queue_s {
pthread_cond_t notFull, notEmpty;
pthread_cond_t belowFullDlyWtrMrk; /* below eFLOWCTL_FULL_DELAY watermark */
pthread_cond_t belowLightDlyWtrMrk; /* below eFLOWCTL_FULL_DELAY watermark */
- pthread_cond_t condDAReady;/* signalled when the DA queue is fully initialized and ready for processing */
int bThrdStateChanged; /* at least one thread state has changed if 1 */
/* end sync variables */
/* the following variables are always present, because they
--
cgit v1.2.3
From f3d354da3e373f9c4890a78e5274a6ba02f1c8cb Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Fri, 11 Feb 2011 17:47:30 +0100
Subject: bugfix: very long running actions could prevent shutdown under some
circumstances
This has now been solved, at least for common situations.
---
ChangeLog | 3 +++
plugins/imfile/imfile.c | 6 +++---
runtime/queue.c | 2 +-
threads.c | 6 ++++--
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6e34a436..7d2bbc20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@ Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-??
when in disk-assisted mode. This especially affected imfile, which
created unnecessarily queue files if a large set of input file data was
to process.
+- bugfix: very long running actions could prevent shutdown under some
+ circumstances. This has now been solved, at least for common
+ situations.
---------------------------------------------------------------------------
Version 5.7.3 [V5-BETA] (rgerhards), 2011-02-07
- added support for processing multi-line messages in imfile
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index 7f6b9c24..c71e425e 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -291,13 +291,13 @@ CODESTARTrunInput
pthread_cleanup_push(inputModuleCleanup, NULL);
while(glbl.GetGlobalInputTermState() == 0) {
do {
- if(glbl.GetGlobalInputTermState() == 1)
- break; /* terminate input! */
bHadFileData = 0;
for(i = 0 ; i < iFilPtr ; ++i) {
+ if(glbl.GetGlobalInputTermState() == 1)
+ break; /* terminate input! */
pollFile(&files[i], &bHadFileData);
}
- } while(iFilPtr > 1 && bHadFileData == 1); /* warning: do...while()! */
+ } while(iFilPtr > 1 && bHadFileData == 1 && glbl.GetGlobalInputTermState() == 0); /* warning: do...while()! */
/* Note: the additional 10ns wait is vitally important. It guards rsyslog against totally
* hogging the CPU if the users selects a polling interval of 0 seconds. It doesn't hurt any
diff --git a/runtime/queue.c b/runtime/queue.c
index 9f63a338..76327f6a 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -1497,7 +1497,7 @@ DequeueConsumable(qqueue_t *pThis, wti_t *pWti)
* now that we dequeue batches of pointers, this is much less an issue...
* rgerhards, 2009-04-22
*/
- if(iQueueSize < pThis->iFullDlyMrk / 2) {
+ if(iQueueSize < pThis->iFullDlyMrk / 2 || glbl.GetGlobalInputTermState() == 1) {
pthread_cond_broadcast(&pThis->belowFullDlyWtrMrk);
}
diff --git a/threads.c b/threads.c
index d4e14527..fcafce4b 100644
--- a/threads.c
+++ b/threads.c
@@ -101,12 +101,14 @@ thrdTerminateNonCancel(thrdInfo_t *pThis)
do {
d_pthread_mutex_lock(&pThis->mutThrd);
pthread_kill(pThis->thrdID, SIGTTIN);
- timeoutComp(&tTimeout, 10); /* a fixed 10ms timeout, do after lock (may take long!) */
+ timeoutComp(&tTimeout, 1000); /* a fixed 1sec timeout */
ret = d_pthread_cond_timedwait(&pThis->condThrdTerm, &pThis->mutThrd, &tTimeout);
d_pthread_mutex_unlock(&pThis->mutThrd);
if(Debug) {
if(ret == ETIMEDOUT) {
- dbgprintf("input thread term: had a timeout waiting on thread termination\n");
+ dbgprintf("input thread term: timeout expired waiting on thread termination - canceling\n");
+ pthread_cancel(pThis->thrdID);
+ pThis->bIsActive = 0;
} else if(ret == 0) {
dbgprintf("input thread term: thread returned normally and is terminated\n");
} else {
--
cgit v1.2.3
From 49c2bc380c34c346dafffe5c5a4059fa2f604680 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Tue, 15 Feb 2011 11:06:15 +0100
Subject: improved error reporting for $WorkDirectory
non-existance and other detectable problems are now reported,
and the work directory is NOT set in this case
---
ChangeLog | 3 +++
runtime/glbl.c | 37 ++++++++++++++++++++++++++++++++++++-
runtime/rsyslog.h | 1 +
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 7d2bbc20..2a22f5b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-??
- added pmsnare parser module (written by David Lang)
- enhanced imfile to support non-cancel input termination
- improved systemd socket activation thanks to Marius Tomaschweski
+- improved error reporting for $WorkDirectory
+ non-existance and other detectable problems are now reported,
+ and the work directory is NOT set in this case
- bugfix: pmsnare causded abort under some conditions
- bugfix: abort if imfile reads file line of more than 64KiB
Thanks to Peter Eisentraut for reporting and analysing this problem.
diff --git a/runtime/glbl.c b/runtime/glbl.c
index c7bb88a5..68eb276c 100644
--- a/runtime/glbl.c
+++ b/runtime/glbl.c
@@ -31,6 +31,9 @@
#include "config.h"
#include
#include
+#include
+#include
+#include
#include
#include "rsyslog.h"
@@ -40,6 +43,7 @@
#include "glbl.h"
#include "prop.h"
#include "atomic.h"
+#include "errmsg.h"
/* some defaults */
#ifndef DFLT_NETSTRM_DRVR
@@ -49,6 +53,7 @@
/* static data */
DEFobjStaticHelpers
DEFobjCurrIf(prop)
+DEFobjCurrIf(errmsg)
/* static data
* For this object, these variables are obviously what makes the "meat" of the
@@ -147,6 +152,35 @@ static void SetGlobalInputTermination(void)
}
+/* This function is used to set the global work directory name.
+ * It verifies that the provided directory actually exists and
+ * emits an error message if not.
+ * rgerhards, 2011-02-16
+ */
+static rsRetVal setWorkDir(void __attribute__((unused)) *pVal, uchar *pNewVal)
+{
+ DEFiRet;
+ struct stat sb;
+
+ if(stat((char*) pNewVal, &sb) != 0) {
+ errmsg.LogError(0, RS_RET_ERR_WRKDIR, "$WorkDirectory: %s can not be "
+ "accessed, probably does not exist - directive ignored", pNewVal);
+ ABORT_FINALIZE(RS_RET_ERR_WRKDIR);
+ }
+
+ if(!S_ISDIR(sb.st_mode)) {
+ errmsg.LogError(0, RS_RET_ERR_WRKDIR, "$WorkDirectory: %s not a directory - directive ignored",
+ pNewVal);
+ ABORT_FINALIZE(RS_RET_ERR_WRKDIR);
+ }
+
+ free(pszWorkDir);
+ pszWorkDir = pNewVal;
+
+finalize_it:
+ RETiRet;
+}
+
/* return our local hostname. if it is not set, "[localhost]" is returned
*/
static uchar*
@@ -354,9 +388,10 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
BEGINAbstractObjClassInit(glbl, 1, OBJ_IS_CORE_MODULE) /* class, version */
/* request objects we use */
CHKiRet(objUse(prop, CORE_COMPONENT));
+ CHKiRet(objUse(errmsg, CORE_COMPONENT));
/* register config handlers (TODO: we need to implement a way to unregister them) */
- CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, NULL, &pszWorkDir, NULL));
+ CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, setWorkDir, NULL, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"dropmsgswithmaliciousdnsptrrecords", 0, eCmdHdlrBinary, NULL, &bDropMalPTRMsgs, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdriver", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvr, NULL));
CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdrivercafile", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvrCAF, NULL));
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 0402f159..78e61bcb 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -340,6 +340,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_ERR_HDFS_WRITE = -2178, /**< error writing to HDFS */
RS_RET_ERR_HDFS_OPEN = -2179, /**< error during hdfsOpen (e.g. file does not exist) */
RS_RET_FILE_NOT_SPECIFIED = -2180, /**< file name not configured where this was required */
+ RS_RET_ERR_WRKDIR = -2181, /**< problems with the rsyslog working directory */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */
--
cgit v1.2.3
From 772e0ae8460478e43caac55dfa3182dd4b58b52a Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 16 Feb 2011 11:46:56 +0100
Subject: cleanup: no longer parameter in iminternal system removed
---
tools/iminternal.c | 6 ++----
tools/iminternal.h | 5 ++---
tools/syslogd.c | 5 ++---
3 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/tools/iminternal.c b/tools/iminternal.c
index bd1fa128..12534ba0 100644
--- a/tools/iminternal.c
+++ b/tools/iminternal.c
@@ -89,7 +89,7 @@ finalize_it:
* The interface of this function is modelled after syslogd/logmsg(),
* for which it is an "replacement".
*/
-rsRetVal iminternalAddMsg(int pri, msg_t *pMsg)
+rsRetVal iminternalAddMsg(msg_t *pMsg)
{
DEFiRet;
iminternal_t *pThis;
@@ -98,7 +98,6 @@ rsRetVal iminternalAddMsg(int pri, msg_t *pMsg)
CHKiRet(iminternalConstruct(&pThis));
- pThis->pri = pri;
pThis->pMsg = pMsg;
CHKiRet(llAppend(&llMsgs, NULL, (void*) pThis));
@@ -118,7 +117,7 @@ finalize_it:
* from the list and return it to the caller. The caller is
* responsible for freeing the message!
*/
-rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg)
+rsRetVal iminternalRemoveMsg(msg_t **ppMsg)
{
DEFiRet;
iminternal_t *pThis;
@@ -128,7 +127,6 @@ rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg)
assert(ppMsg != NULL);
CHKiRet(llGetNextElt(&llMsgs, &llCookie, (void*)&pThis));
- *pPri = pThis->pri;
*ppMsg = pThis->pMsg;
pThis->pMsg = NULL; /* we do no longer own it - important for destructor */
diff --git a/tools/iminternal.h b/tools/iminternal.h
index f1062a15..8a9e2506 100644
--- a/tools/iminternal.h
+++ b/tools/iminternal.h
@@ -33,7 +33,6 @@
* The short name is cslch (Configfile SysLine CommandHandler)
*/
struct iminternal_s { /* config file sysline parse entry */
- int pri;
msg_t *pMsg; /* the message (in all its glory) */
};
typedef struct iminternal_s iminternal_t;
@@ -41,8 +40,8 @@ typedef struct iminternal_s iminternal_t;
/* prototypes */
rsRetVal modInitIminternal(void);
rsRetVal modExitIminternal(void);
-rsRetVal iminternalAddMsg(int pri, msg_t *pMsg);
+rsRetVal iminternalAddMsg(msg_t *pMsg);
rsRetVal iminternalHaveMsgReady(int* pbHaveOne);
-rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg);
+rsRetVal iminternalRemoveMsg(msg_t **ppMsg);
#endif /* #ifndef IMINTERNAL_H_INCLUDED */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index cdb31ef6..c4a3b270 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -574,7 +574,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
}
if(bHaveMainQueue == 0) { /* not yet in queued mode */
- iminternalAddMsg(pri, pMsg);
+ iminternalAddMsg(pMsg);
} else {
/* we have the queue, so we can simply provide the
* message to the queue engine.
@@ -1868,10 +1868,9 @@ void sigttin_handler()
*/
static inline void processImInternal(void)
{
- int iPri;
msg_t *pMsg;
- while(iminternalRemoveMsg(&iPri, &pMsg) == RS_RET_OK) {
+ while(iminternalRemoveMsg(&pMsg) == RS_RET_OK) {
submitMsg(pMsg);
}
}
--
cgit v1.2.3
From 7052d3c378ff600f9f03a05b1918d8eda6b76e2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dra=C5=BEen=20Ka=C4=8Dar?=
Date: Wed, 16 Feb 2011 18:20:59 +0100
Subject: bugfix: fixed compile problem due to empty structs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
this occured only on some platforms/compilers. thanks to Dražen Kačar
for the fix
Signed-off-by: Rainer Gerhards
---
ChangeLog | 3 +++
runtime/datetime.h | 1 +
runtime/errmsg.h | 1 +
runtime/expr.h | 1 +
runtime/modules.h | 1 +
tools/omdiscard.c | 1 +
6 files changed, 8 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 2a22f5b2..7fba4e8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@ Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-??
- bugfix: very long running actions could prevent shutdown under some
circumstances. This has now been solved, at least for common
situations.
+- bugfix: fixed compile problem due to empty structs
+ this occured only on some platforms/compilers. thanks to Dražen Kačar
+ for the fix
---------------------------------------------------------------------------
Version 5.7.3 [V5-BETA] (rgerhards), 2011-02-07
- added support for processing multi-line messages in imfile
diff --git a/runtime/datetime.h b/runtime/datetime.h
index 82bd415b..70bbf416 100644
--- a/runtime/datetime.h
+++ b/runtime/datetime.h
@@ -28,6 +28,7 @@
/* the datetime object */
typedef struct datetime_s {
+ char dummy;
} datetime_t;
diff --git a/runtime/errmsg.h b/runtime/errmsg.h
index 799954fb..ac7018b3 100644
--- a/runtime/errmsg.h
+++ b/runtime/errmsg.h
@@ -30,6 +30,7 @@
/* the errmsg object */
typedef struct errmsg_s {
+ char dummy;
} errmsg_t;
diff --git a/runtime/expr.h b/runtime/expr.h
index 974b71ec..1afe1a1f 100644
--- a/runtime/expr.h
+++ b/runtime/expr.h
@@ -30,6 +30,7 @@
/* a node inside an expression tree */
typedef struct exprNode_s {
+ char dummy;
} exprNode_t;
diff --git a/runtime/modules.h b/runtime/modules.h
index 49586e8d..df1afbc3 100644
--- a/runtime/modules.h
+++ b/runtime/modules.h
@@ -119,6 +119,7 @@ struct modInfo_s {
rsRetVal (*parseSelectorAct)(uchar**, void**,omodStringRequest_t**);
} om;
struct { /* data for library modules */
+ char dummy;
} lm;
struct { /* data for parser modules */
rsRetVal (*parse)(msg_t*);
diff --git a/tools/omdiscard.c b/tools/omdiscard.c
index f13144e8..227ad8e2 100644
--- a/tools/omdiscard.c
+++ b/tools/omdiscard.c
@@ -44,6 +44,7 @@ MODULE_TYPE_OUTPUT
DEF_OMOD_STATIC_DATA
typedef struct _instanceData {
+ char dummy;
} instanceData;
/* we do not need a createInstance()!
--
cgit v1.2.3
From 237df37a86479e1f60e73bdcd1da15ccc319fa15 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Thu, 17 Feb 2011 12:42:37 +0100
Subject: bugfix: testbench was not activated if no Java was present on system
... what actually was a left-over. Java is no longer required.
---
ChangeLog | 2 ++
configure.ac | 5 -----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 72e29465..14723f3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,8 @@ Version 5.6.3 [V5-STABLE] (rgerhards), 2011-01-26
- bugfix: batches which had actions in error were not properly retried in
all cases
- bugfix: imfile did duplicate messages under some circumstances
+- bugfix: testbench was not activated if no Java was present on system
+ ... what actually was a left-over. Java is no longer required.
---------------------------------------------------------------------------
Version 5.6.2 [V5-STABLE] (rgerhards), 2010-11-30
- bugfix: compile failed on systems without epoll_create1()
diff --git a/configure.ac b/configure.ac
index aeccfb8b..dd681617 100644
--- a/configure.ac
+++ b/configure.ac
@@ -746,11 +746,6 @@ AC_ARG_ENABLE(testbench,
esac],
[enable_testbench=yes]
)
-if test "$enable_testbench" = "yes"; then
- if test x$HAVE_JAVAC = x; then
- enable_testbench='no'
- fi
-fi
AM_CONDITIONAL(ENABLE_TESTBENCH, test x$enable_testbench = xyes)
--
cgit v1.2.3
From c550907139b9a13e1afd771f94f46a153fde08a2 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Thu, 17 Feb 2011 14:25:43 +0100
Subject: preparing for 5.7.4 release
---
ChangeLog | 2 +-
configure.ac | 2 +-
doc/manual.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7fba4e8d..fc2c3c97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
---------------------------------------------------------------------------
-Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-??
+Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-17
- added pmsnare parser module (written by David Lang)
- enhanced imfile to support non-cancel input termination
- improved systemd socket activation thanks to Marius Tomaschweski
diff --git a/configure.ac b/configure.ac
index 8eb840b0..1db9f26e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[5.7.3],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[5.7.4],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/doc/manual.html b/doc/manual.html
index e8a1ccfa..4be37fd5 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ rsyslog support available directly from the source!
Please visit the rsyslog sponsor's page
to honor the project sponsors or become one yourself! We are very grateful for any help towards the
project goals.
-This documentation is for version 5.7.3 (beta branch) of rsyslog.
+
This documentation is for version 5.7.4 (beta branch) of rsyslog.
Visit the rsyslog status page
to obtain current version information and project status.
If you like rsyslog, you might
--
cgit v1.2.3
From 39406781e51c7305cb9f35f5f9fed9c10dea9ecd Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Thu, 17 Feb 2011 15:12:54 +0100
Subject: bugfix: minor race condition in action.c - considered cosmetic
This is considered cosmetic as multiple threads tried to write exactly
the same value into the same memory location without sync. The method
has been changed so this can no longer happen.
---
ChangeLog | 6 ++++++
action.c | 25 +++++++++++++------------
action.h | 1 -
threads.c | 2 +-
4 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fc2c3c97..a78e9e62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------
+Version 5.7.5 [V5-BETA] (rgerhards), 2011-02-??
+- bugfix: minor race condition in action.c - considered cosmetic
+ This is considered cosmetic as multiple threads tried to write exactly
+ the same value into the same memory location without sync. The method
+ has been changed so this can no longer happen.
+---------------------------------------------------------------------------
Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-17
- added pmsnare parser module (written by David Lang)
- enhanced imfile to support non-cancel input termination
diff --git a/action.c b/action.c
index 4bf8ba04..36830577 100644
--- a/action.c
+++ b/action.c
@@ -494,7 +494,8 @@ static inline void actionSuspend(action_t *pThis, time_t ttNow)
* kind of facility: in the first place, the module should return a proper indication
* of its inability to recover. -- rgerhards, 2010-04-26.
*/
-static rsRetVal actionDoRetry(action_t *pThis, time_t ttNow)
+static inline rsRetVal
+actionDoRetry(action_t *pThis, time_t ttNow, int *pbShutdownImmediate)
{
int iRetries;
int iSleepPeriod;
@@ -504,7 +505,7 @@ static rsRetVal actionDoRetry(action_t *pThis, time_t ttNow)
ASSERT(pThis != NULL);
iRetries = 0;
- while((*pThis->pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) {
+ while((*pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) {
iRet = pThis->pMod->tryResume(pThis->pModData);
if((pThis->iResumeOKinRow > 999) && (pThis->iResumeOKinRow % 1000 == 0)) {
bTreatOKasSusp = 1;
@@ -524,7 +525,7 @@ static rsRetVal actionDoRetry(action_t *pThis, time_t ttNow)
iSleepPeriod = pThis->iResumeInterval;
ttNow += iSleepPeriod; /* not truly exact, but sufficiently... */
srSleep(iSleepPeriod, 0);
- if(*pThis->pbShutdownImmediate) {
+ if(*pbShutdownImmediate) {
ABORT_FINALIZE(RS_RET_FORCE_TERM);
}
}
@@ -545,7 +546,7 @@ finalize_it:
/* try to resume an action -- rgerhards, 2007-08-02
* changed to new action state engine -- rgerhards, 2009-05-07
*/
-static rsRetVal actionTryResume(action_t *pThis)
+static rsRetVal actionTryResume(action_t *pThis, int *pbShutdownImmediate)
{
DEFiRet;
time_t ttNow = NO_TIME_PROVIDED;
@@ -569,7 +570,7 @@ static rsRetVal actionTryResume(action_t *pThis)
if(pThis->eState == ACT_STATE_RTRY) {
if(ttNow == NO_TIME_PROVIDED) /* use cached result if we have it */
datetime.GetTime(&ttNow);
- CHKiRet(actionDoRetry(pThis, ttNow));
+ CHKiRet(actionDoRetry(pThis, ttNow, pbShutdownImmediate));
}
if(Debug && (pThis->eState == ACT_STATE_RTRY ||pThis->eState == ACT_STATE_SUSP)) {
@@ -586,12 +587,12 @@ finalize_it:
* depending on its current state.
* rgerhards, 2009-05-07
*/
-static inline rsRetVal actionPrepare(action_t *pThis)
+static inline rsRetVal actionPrepare(action_t *pThis, int *pbShutdownImmediate)
{
DEFiRet;
assert(pThis != NULL);
- CHKiRet(actionTryResume(pThis));
+ CHKiRet(actionTryResume(pThis, pbShutdownImmediate));
/* if we are now ready, we initialize the transaction and advance
* action state accordingly
@@ -800,14 +801,14 @@ finalize_it:
* rgerhards, 2008-01-28
*/
static inline rsRetVal
-actionProcessMessage(action_t *pThis, msg_t *pMsg, void *actParams)
+actionProcessMessage(action_t *pThis, msg_t *pMsg, void *actParams, int *pbShutdownImmediate)
{
DEFiRet;
ASSERT(pThis != NULL);
ISOBJ_TYPE_assert(pMsg, msg);
- CHKiRet(actionPrepare(pThis));
+ CHKiRet(actionPrepare(pThis, pbShutdownImmediate));
if(pThis->eState == ACT_STATE_ITX)
CHKiRet(actionCallDoAction(pThis, pMsg, actParams));
@@ -834,7 +835,7 @@ finishBatch(action_t *pThis, batch_t *pBatch)
FINALIZE; /* nothing to do */
}
- CHKiRet(actionPrepare(pThis));
+ CHKiRet(actionPrepare(pThis, pBatch->pbShutdownImmediate));
if(pThis->eState == ACT_STATE_ITX) {
iRet = pThis->pMod->mod.om.endTransaction(pThis->pModData);
switch(iRet) {
@@ -901,7 +902,8 @@ tryDoAction(action_t *pAction, batch_t *pBatch, int *pnElem)
&& pBatch->pElem[i].state != BATCH_STATE_DISC
&& ((pAction->bExecWhenPrevSusp == 0) || pBatch->pElem[i].bPrevWasSuspended) ) {
pMsg = (msg_t*) pBatch->pElem[i].pUsrp;
- localRet = actionProcessMessage(pAction, pMsg, pBatch->pElem[i].staticActParams);
+ localRet = actionProcessMessage(pAction, pMsg, pBatch->pElem[i].staticActParams,
+ pBatch->pbShutdownImmediate);
DBGPRINTF("action call returned %d\n", localRet);
/* Note: we directly modify the batch object state, because we know that
* wo do not overwrite BATCH_STATE_DISC indicators!
@@ -1072,7 +1074,6 @@ processBatchMain(action_t *pAction, batch_t *pBatch, int *pbShutdownImmediate)
pbShutdownImmdtSave = pBatch->pbShutdownImmediate;
pBatch->pbShutdownImmediate = pbShutdownImmediate;
- pAction->pbShutdownImmediate = pBatch->pbShutdownImmediate;
CHKiRet(prepareBatch(pAction, pBatch));
/* We now must guard the output module against execution by multiple threads. The
diff --git a/action.h b/action.h
index 0c86ef88..e57a0acf 100644
--- a/action.h
+++ b/action.h
@@ -88,7 +88,6 @@ struct action_s {
SYNC_OBJ_TOOL; /* required for mutex support */
pthread_mutex_t mutActExec; /* mutex to guard actual execution of doAction for single-threaded modules */
uchar *pszName; /* action name (for documentation) */
- int *pbShutdownImmediate;/* to facilitate shutdown, if var is 1, shut down immediately */
DEF_ATOMIC_HELPER_MUT(mutCAS);
};
diff --git a/threads.c b/threads.c
index fcafce4b..11c9a1d8 100644
--- a/threads.c
+++ b/threads.c
@@ -196,8 +196,8 @@ static void* thrdStarter(void *arg)
* keep the thread debugger happer, it would not really be necessary with
* the logic we employ...)
*/
- pThis->bIsActive = 0;
d_pthread_mutex_lock(&pThis->mutThrd);
+ pThis->bIsActive = 0;
pthread_cond_signal(&pThis->condThrdTerm);
d_pthread_mutex_unlock(&pThis->mutThrd);
--
cgit v1.2.3