32 Commits

Author SHA1 Message Date
Rainer Gerhards
b57db5ce3c ratelimiting: data race in Linux-like ratelimiter
access to the Linux-like ratelimiter was not properly synchronized, and
the system rate-limiter was not using it in any case.

This could lead to the rate-limit settings not being properly
respected, but no "hard error".
2017-11-10 19:03:09 +01:00
Rainer Gerhards
af52d2ec62 cosmetic: fix (mainly) style issues 2017-10-13 12:29:15 +02:00
Rainer Gerhards
87b29734f3 core bugfix: memory leak if no parser handles message
if no parser can handle a message, the message object is
leaked. If this happens frequently, a rather large leak exists.

see also https://github.com/rsyslog/rsyslog/issues/102
2017-05-11 12:48:08 +02:00
Jiri Vymazal
7d895339ee added formatting for rate-limit hit source 2017-04-18 17:02:37 +02:00
Jiri Vymazal
96772ba3ad added logging of host&process name of rate-limited messages source 2017-02-10 14:19:21 +01:00
Heikki Kemppainen
a6c8f9ad68 For ratelimit checking, added check for time going backwards. If time goes backwards, then ratelimit begin and done values must be set to zero 2017-01-16 09:26:29 +02:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
b3940cb966 remove excessive "inline" attributes 2016-06-03 12:24:27 +02:00
Rainer Gerhards
804823a09a ratelimiting system: fix data types 2016-06-01 11:43:32 +02:00
Tomas Heinrich
081840c875 bugfix: always initialize an output parameter
Error: CLANG_WARNING:
rsyslog-7.4.10/runtime/ratelimit.c:255:13: warning: The left operand of '!=' is a garbage value
2014-07-22 17:47:16 +02:00
Rainer Gerhards
1c375b2e6a improve debug output for ReduceRepeatMsgs 2014-05-06 09:36:15 +02:00
Rainer Gerhards
b51dd22ff6 bugfix: linux kernel-like ratelimiter did not work properly with all inputs
(for example, it did not work with imdup). The reason was that
the PRI value was used, but that needed parsing of the message, which
was done too late.
2013-12-02 11:52:48 +01:00
Rainer Gerhards
1f6d402d50 imjournal fix: put ratelimiter destruction in wrong entry point
No regression, this was in recently written, never-released code.
2013-06-17 14:18:23 +02:00
Rainer Gerhards
4357348b96 implement new ratelimiting mode for imjournal
and make imjournal use it.

The new mode is needed, as imjournal uses journal's timestamp
as message generation time (which otherwise is when the message
entered the system, and the ratelimiter uses this as current
timestamp in order to save performance).

It is debatable if imjournal is doing the right thing here. But
it doesn't feel totally wrong. So let's safe that debate for
later ;)
2013-06-17 13:34:17 +02:00
Tomas Heinrich
a3923fd54f bugfix: prevent calling tellLostCnt() twice 2013-06-12 08:42:14 +02:00
Tomas Heinrich
2547716dbc bugfix: prevent another endless loop in the ratelimiter
The message that reports how many messages were lost due to
ratelimiting was sent before reseting the state that led to it. If it
itself got ratelimited, this could lead to an endless loop.
2013-06-12 08:42:14 +02:00
Tomas Heinrich
573e3fb27c bugfix: prevent an endless loop in the ratelimiter
If messages are being dropped because of ratelimiting, an internal
message is generated to inform about this fact. This should happen
only uppon the firs occurance but the counter that tracks the number
of dropped messages was incremented only after sending the message. If
the message itself gets ratelimited, an endless loop spins out of
control. Thanks to Jerry James for notifying about this.
2013-06-10 08:06:36 +02:00
Tomas Heinrich
4e0c339586 bugfix: prevent a segfault if ratelimit condition is not met
Move the severity-check logic inside the ratelimiter and add a new
function ratelimitSetSeverity() to manipulate the treshold.
Currently only utilized by the imuxsock module.
2013-04-13 11:27:51 +02:00
Rainer Gerhards
9602d83730 fix: memory leak in linux-like ratelimiter 2012-10-15 18:46:08 +02:00
Rainer Gerhards
048a6b9573 fix: we need to use loadConf to access global settings
Hint: globals need to be re-done...
2012-10-15 18:11:51 +02:00
Rainer Gerhards
1117060666 fix: linux-like ratelimiting did not emit "final" message...
on destruction of rate limiter.
2012-10-15 17:16:25 +02:00
Rainer Gerhards
cfa8d01f52 imptcp: support for Linux-Type ratelimiting added 2012-10-15 17:01:00 +02:00
Rainer Gerhards
34a88a7e9a ratelimit: added linux-like ratelimiter type 2012-10-15 16:39:36 +02:00
Rainer Gerhards
6ab4666622 ratelimit: respect $repeatedmsgreduction setting 2012-10-15 13:05:42 +02:00
Rainer Gerhards
912db8bbac milestone: convert imuxsock to ratelimitAddMsg() interface 2012-10-15 12:38:49 +02:00
Rainer Gerhards
25a8496a6a imudp: add input batching & ratelimiter interface 2012-10-15 11:48:43 +02:00
Rainer Gerhards
3806643baa ratelimiter: enable thread-safe mode & (related) API changes 2012-10-15 11:19:22 +02:00
Rainer Gerhards
2a6ff7d53d interface cleanup (probably not final) 2012-10-15 08:55:12 +02:00
Rainer Gerhards
49fb431e0c milestone: ratelimiter used in imptcp 2012-10-15 08:41:04 +02:00
Rainer Gerhards
c7aa09bbb2 milestone: experimental rate limiter used in imuxsock 2012-10-12 18:30:51 +02:00
Rainer Gerhards
4269e45781 new ratelimit: interface plumbing added
no actual implementation yet done
2012-10-09 18:54:25 +02:00