99 Commits

Author SHA1 Message Date
Nelson Yen
dc9899ec98 Drop messages rejected due to being too large.
Drop messages that were rejected due to 'RD_KAFKA_RESP_ERR_MSG_SIZE_TOO_LARGE' error.
2019-03-27 13:32:47 -07:00
Rainer Gerhards
fd31e1c095
omkafka bugfix: build failure due to inconsistent type
fails depending on platform and settings; was somehow undetected by CI
2019-03-21 17:59:39 +01:00
Ludo Brands
4825f685d0 omkafka: add support for dynamic keys 2019-03-01 12:09:32 +01:00
Philippe Duveau
11c6365eba AIX_port: corrects style and compatibility issues (3) 2019-02-14 17:17:37 +01:00
Philippe Duveau
9ad7324dfa AIX_port: second phase 2019-02-14 14:36:05 +01:00
pcullen65
10b8235650 omkafka: Add ability to dump librdkafka statistics to a file (#3400)
omkafka: Add ability to dump librdkafka statistics to a file

Use statsFile to specify statistics output file; also requires setting statistics.interval.ms confparam to a non-zero value.
2019-01-15 17:08:37 +01:00
76c63f34ae testbench: Added new omkafka tests for more coverage.
Also fixed minor debug output seqfaults when dynatopic was used.

closes: https://github.com/rsyslog/rsyslog/issues/3410
2019-01-14 09:17:55 +01:00
Rainer Gerhards
9bece39dc6
SQUASH
debug cleanup: remove some old, no longer used macros
2018-10-30 12:46:04 +01:00
48c48207f8 kafka: Fixed failing imkafka/omkafka when "debug" parameter was set.
also added some debug output when reporterr is off fo failed parameters.
2018-09-06 17:31:03 +02:00
0d8f02b87e omkafka: When Timestamp was NULL, wrong dynamic timestamp was used.
Setting timestamp to 0 now lets kafka handle this.
Also added "RD_KAFKA_V_KEY(NULL,0) if no key is configured.

testbench: Changed kafka server configuration "log.retention.hours"
property to 5000 which avoids that the log cleaner is deleting our
records before they can be processed.
2018-09-06 09:59:45 +02:00
95ed2c573b testbench: Switched to newer kafka/zookeeper versions.
Fixed test configurations (socket timeouts with newer kafka).
Reactivated some kafka tests that work now.

omkafka: Fixed "closeTimeout" setting in action shutdown
2018-08-21 15:00:44 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
0773e1b8f5
Merge pull request #2598 from abwaheed/master
omkafka: added implstats counters for librdkafka returned statistics …
2018-05-02 08:44:33 +02:00
Abdul
ea511b8d57 style fixes 2018-04-05 19:35:28 -07:00
Abdul
55ea311fa1 typo fix 2018-04-04 18:45:23 -07:00
Abdul
77b46d050e fixed tabs and function definition syntax 2018-04-03 17:26:34 -07:00
Rainer Gerhards
8486a860ff omkafka: use "atomic mutex macros"
commit 87c8f478ebd0111c9c8d521020acffa42a4508c9 fixed missing mutex
definition, but did not do so via the macros originally intended for
this purpose. It still was very useful, as the patch made omkafka
compile on systems without atomic operations. And did so without
causing any real overhead.

Nevertheless this commit now adjust to use the rsyslog-core intended
way of doing things.
2018-04-01 18:13:51 +02:00
Abdul
79adc53dea Replacing switch with if statements 2018-03-31 12:21:25 -07:00
Abdul
a65caf7316 omkafka: added implstats counters for librdkafka returned statistics callback and errors 2018-03-30 19:30:50 -07:00
Bruce Wen
87c8f478eb omkafka: fix 'instanceData' has no member named 'mutCurrPartition' 2018-03-20 18:35:43 +08:00
Rainer Gerhards
6daf835cd0 fix build warnings on alpine linux
Alpine compiles with size optimization, and then the compiler
finds a couple of inline functions that are really not worth it.
2018-01-26 17:26:44 +01:00
Rainer Gerhards
0d1658d26f omkafka: fix build problem with old librdkafka 2018-01-14 11:00:26 +01:00
Rainer Gerhards
37ad53b177 omkafka: expose operational status to user where useful
omkafka emits many useful operational status messages only to the debug
log. After careful review, we have exposed many of these as user error
and warning message (ex: librdkafka queue full, so user knows why we
suspend the plugin temporarily). This may have made the module too
chatty. If so, one can always filter out messages via configuration. And
if we really went overboard, we can undo those parts with the next
release. So IMHO it's better to give a bit more than less, as this
definitely eases troubleshooting for users.

closes https://github.com/rsyslog/rsyslog/issues/2314
2018-01-01 13:58:50 +01:00
Rainer Gerhards
8956f35841 omkafka: fix multithreading
omkafka has several issue if multiple worker instances are used. This commit
actually make the module use a single worker thread at max. Reasoning:
Librdkafka creates background threads itself. So omkafka basically needs to move
memory buffers over to librdkafka, which then does the heavy hauling. As such, we
think that it is best to run max one wrkr instance of omkafka -- otherwise we just
get additional locking (contention) overhead without any real gain. As such,
we use a global mutex for doAction which ensures only one worker can be active
at any given time. That mutex is also used to guard utility functions (like
tryResume) which may also be accessed by multiple workers in parallel.
Note: shall this method be changed, the kafka connection/suspension handling needs
to be refactored. The current code assumes that all workers share state information
including librdkafka handles.

closes https://github.com/rsyslog/rsyslog/issues/2313
2017-12-30 10:58:14 +01:00
Rainer Gerhards
c9543c6543 omkafka: fix potential memory leak
if kafka produce fails when resubmitting messages, the message object
is duplicated. This potentially leads to a mem leak or message duplication
(not fully checked yet).
2017-12-30 10:58:14 +01:00
Rainer Gerhards
ff2bad87d0 omkafka bugfix: potential misadressing
The failed message list is improperly cleaned. This is a regression
from recent commit 4eae19e089b5a83da679fe29398c6b2c10003793, which
was introduced in 8.31.0.

This problem is more likely to happen under heavy load or bad
connectivity, when the local librdkafka queue overruns or message
delivery times out.

closes https://github.com/rsyslog/rsyslog/issues/2184
closes https://github.com/rsyslog/rsyslog/issues/2067
2017-12-21 19:19:10 +01:00
PascalWithopf
29c9fb1f9a codestyle: reduce line length to 120
lines are still checked for a length of 125 because
these are just some of the lines
2017-12-21 17:09:32 +01:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
69be26d115 omkafka bugfix: build fails with older versions of librdkafka
closes https://github.com/rsyslog/rsyslog/issues/2168
2017-12-19 16:30:48 +01:00
BSD Patch
ad62379a34 omkafka: import BSD project patches 2017-12-18 13:22:25 +01:00
Jan Gerhards
3f8c1c26cc omkafka: use new errmsg interface 2017-12-09 16:58:50 +01:00
Rainer Gerhards
9875d04623 omkafka: remove invalid duplicate code
Detected by Coverity scan, CID 185415
2017-12-04 18:59:27 +01:00
Rainer Gerhards
3b9dec9741 "fix" Coverity scan false positives 2017-12-04 09:59:54 +01:00
Rainer Gerhards
fc52aed4cb omkafka: fix missing return code check
fixes https://github.com/rsyslog/rsyslog/issues/2095
2017-11-25 15:49:05 +01:00
Rainer Gerhards
e94c8413ed omkafka: trying to "fix" Coverity scan false positive 2017-11-22 18:39:25 +01:00
Rainer Gerhards
34fb903251 omkafka: fix coding style (no functional changes) 2017-11-22 18:36:18 +01:00
Rainer Gerhards
fe9b00c5b0 omkafka: add warning message if default broker is used
this happens if the "brokers" paraemter is not given. Previously,
this was done silently, now the user knows.
2017-11-22 18:14:25 +01:00
f81a7d36c5 omkafka: wait for kafka shutdown (Old librdkafka versions only) and testbench changes
Changed kafka compression to none in testbench config files.
The compression methods seem to have memory leaks and make valgrind tests unuseable.
2017-11-20 13:03:10 +01:00
Rainer Gerhards
9e806875fd omkafka: fix regression introduced two days ago
regression in unreleased code (missing unlock)

Detected by Coverity scan, CID 185370
2017-11-19 14:22:29 +01:00
Rainer Gerhards
575852fdf9 omkafka: fix regression introduced two days ago
regression in unreleased code

Detected by Coverity scan, CID 185819
2017-11-19 14:19:00 +01:00
Rainer Gerhards
b1fee40e69
Merge pull request #2053 from rgerhards/i-2052
omkafka bufgix: various config parameters did not work
2017-11-18 17:17:22 +01:00
Rainer Gerhards
b9cda4602b omkafka bufgix: various config parameters did not work
These are not even recognized when used and leads to a config startup error message:
* closeTimeout
* reopenOnHup
* resubmitOnFailure
* keepFailedMessages
* failedMsgFile

Reason was invalid use of upper case in config param block.

fixes https://github.com/rsyslog/rsyslog/issues/2052
2017-11-17 17:42:03 +01:00
Rainer Gerhards
4eae19e089 omkafka: refactor to use simpler list class
we do not need arbitrary access to message list, so use the
simplier SLIST_* vs. LIST_*.
2017-11-17 16:02:40 +01:00
Rainer Gerhards
b331549a17 omkafka bugfix: cosmetic memory leak upon rsyslog termination
OS will cleanup, not a real issue, but pollutes memory debuggers.
2017-11-17 15:29:02 +01:00
Rainer Gerhards
51d3263622 omkafka: refactor code, unify failedmsg object constuction 2017-11-17 15:28:56 +01:00
Rainer Gerhards
0c4c7deda7 omkafka bugfix: memory leak
Whenever a message could (temporarily) not be delivered to kafka,
a non-trivial amount of memory was leaked. This could sum up to
quite a big memory leak.

fixes https://github.com/rsyslog/rsyslog/issues/1991
2017-11-17 15:10:07 +01:00
Rainer Gerhards
19cebbf092 omkafka: refactor failed delivery handling and error reporting 2017-11-17 15:10:07 +01:00
Rainer Gerhards
010e9e8156 omkafka: cleanup
make code follow our coding guidelines a bit better
2017-11-17 12:03:23 +01:00
Yin Jifeng
75a3b887ea omkafka: make maxoutqsize resettable 2017-11-17 17:56:06 +08:00
Rainer Gerhards
2fa497f1bd omkafka: refactor deletion of failed message file
Code used a suboptimal command sequence. Refactored this and also
cleaned up things a bit.

Detected by Coverity scan, CID 185722
2017-11-16 15:50:05 +01:00