summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-20 15:11:27 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-20 15:11:27 +0000
commit3ecce195ac8e50115a44c6d416fd42bbfa03aafe (patch)
treebec4e21fb82b36934e66f77324cfea051fc47e36
parent1f1f6746b420d7b5722a9a861e859c19672fa35b (diff)
downloadrsyslog-3ecce195ac8e50115a44c6d416fd42bbfa03aafe.tar.gz
rsyslog-3ecce195ac8e50115a44c6d416fd42bbfa03aafe.tar.xz
rsyslog-3ecce195ac8e50115a44c6d416fd42bbfa03aafe.zip
bugfix: message object was not properly synchronized when the main queue
had a single thread and non-direct action queues were used
-rw-r--r--ChangeLog2
-rw-r--r--action.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 88125377..54f6ccdf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ Version 3.12.0 (rgerhards), 2008-02-??
- general code cleanup and further modularization
- $MainMessageQueueDiscardSeverity can now also handle textual severities
(previously only integers)
+- bugfix: message object was not properly synchronized when the
+ main queue had a single thread and non-direct action queues were used
---------------------------------------------------------------------------
Version 3.11.3 (rgerhards), 2008-02-18
- fixed a bug in imklog which lead to duplicate message content in
diff --git a/action.c b/action.c
index 938aefaf..36eb94df 100644
--- a/action.c
+++ b/action.c
@@ -187,6 +187,14 @@ actionConstructFinalize(action_t *pThis)
/* find a name for our queue */
snprintf((char*) pszQName, sizeof(pszQName)/sizeof(uchar), "action %d queue", iActionNbr);
+ /* we need to make a safety check: if the queue is NOT in direct mode, a single
+ * message object may be accessed by multiple threads. As such, we need to enable
+ * msg object thread safety in this case (this costs a bit performance and thus
+ * is not enabled by default. -- rgerhards, 2008-02-20
+ */
+ if(ActionQueType != QUEUETYPE_DIRECT)
+ MsgEnableThreadSafety();
+
/* create queue */
/* action queues always (for now) have just one worker. This may change when
* we begin to implement an interface the enable output modules to request