summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-16 17:44:01 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-16 17:44:01 +0200
commit10dcb23ae5828c239a1d8518e90c7d6d9e2ea1a8 (patch)
tree83acd28facadcadbbc5efdc97334c6f32dc303cf
parent75187bc1839bd5ba9d0ef652ee9e9037f0e2a95e (diff)
downloadrsyslog-10dcb23ae5828c239a1d8518e90c7d6d9e2ea1a8.tar.gz
rsyslog-10dcb23ae5828c239a1d8518e90c7d6d9e2ea1a8.tar.bz2
rsyslog-10dcb23ae5828c239a1d8518e90c7d6d9e2ea1a8.zip
bugfix: omelasticsearch: did not correctly initialize stats counters
This usually did not lead to any problems, because they are in static memory, which is initialized to zero by the OS when the plugin is loaded. But it may cause problems especially on systems that do not support atomic instructions - in this case the associated mutexes also did not get properly initialized.
-rw-r--r--ChangeLog8
-rw-r--r--plugins/omelasticsearch/omelasticsearch.c3
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b3632fe3..e3c25cb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,7 +11,13 @@ Version 7.4.5 [v7.4-stable] 2013-09-??
- now requires libestr 0.1.8 as early versions had a nasty bug in
string comparisons
- omelasticsearch: add failed.httprequests stats counter
-- bugfix omelasticsearch: correct failed.http stats counter
+- bugfix: omelasticsearch: correct failed.http stats counter
+- bugfix: omelasticsearch: did not correctly initialize stats counters
+ This usually did not lead to any problems, because they are in static
+ memory, which is initialized to zero by the OS when the plugin is
+ loaded. But it may cause problems especially on systems that do not
+ support atomic instructions - in this case the associated mutexes also
+ did not get properly initialized.
- bugfix: mmanon did not detect all IP addresses in rewrite mode
The problem occured if two IPs were close to each other and the first one
was shrunk.
diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c
index 5d4c97c3..240d19e6 100644
--- a/plugins/omelasticsearch/omelasticsearch.c
+++ b/plugins/omelasticsearch/omelasticsearch.c
@@ -1001,13 +1001,16 @@ CODEmodInit_QueryRegCFSLineHdlr
/* support statistics gathering */
CHKiRet(statsobj.Construct(&indexStats));
CHKiRet(statsobj.SetName(indexStats, (uchar *)"omelasticsearch"));
+ STATSCOUNTER_INIT(indexSubmit, mutCtrIndexSubmit);
CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"submitted",
ctrType_IntCtr, &indexSubmit));
+ STATSCOUNTER_INIT(indexHTTPFail, mutCtrIndexHTTPFail);
CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.http",
ctrType_IntCtr, &indexHTTPFail));
STATSCOUNTER_INIT(indexHTTPReqFail, mutCtrIndexHTTPReqFail);
CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.httprequests",
ctrType_IntCtr, &indexHTTPReqFail));
+ STATSCOUNTER_INIT(indexESFail, mutCtrIndexESFail);
CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.es",
ctrType_IntCtr, &indexESFail));
CHKiRet(statsobj.ConstructFinalize(indexStats));