10759 Commits

Author SHA1 Message Date
Rainer Gerhards
960aa3cd9d Merge pull request #1667 from rgerhards/i-1661
impstats: add new ressoure counter "openfiles"
2017-07-19 14:51:41 +02:00
Rainer Gerhards
6770cffe0e Merge branch 'imptcp-robustness-v8.25.0' into imptcp-robustness 2017-07-19 14:24:07 +02:00
Rainer Gerhards
3f484f2808 imptcp: add session statistics conunter
- session.opened
- session.openfailed
- session.closed

These are useful for monitoring, capacity planning and troubleshooting. They
are reported on a per-listener basis.
2017-07-19 14:14:42 +02:00
Rainer Gerhards
79b4e1eae4 imptcp: cosmetic fix 2017-07-19 14:03:17 +02:00
Rainer Gerhards
8350374ee9 imptcp: fix potential socket leak on session shutdown
imptcp first tries to remove a to-be-shut-down socket from the
epoll set, and errors out if that does not work. In that case, the
underlying socket will be leaked.

This patch refactors the code; most importantly, it is not necessary
to remove the socket from the epoll set, as this happens automatically
on close. As such, we simply remove that part of the code, which
also removes the root cause of the socket leak.
2017-07-19 13:50:15 +02:00
PascalWithopf
5132bc32d2 imtcp: framing/size errmsgs contain remote peer
closes https://github.com/rsyslog/rsyslog/issues/1676
2017-07-19 11:58:40 +02:00
PascalWithopf
792746a035 imptcp: framing/size errmsgs contain remote peer
closes https://github.com/rsyslog/rsyslog/issues/1664
2017-07-19 11:24:38 +02:00
PascalWithopf
d4cc699129 pmnormalize: add new parser module pmnormalize 2017-07-19 08:58:20 +02:00
PascalWithopf
b7c32be2af MsgSetPropsViaJSON: Possibility to give a json object as parameter instead of a string 2017-07-19 08:56:32 +02:00
PascalWithopf
399f6023fd imklog: test for parameter permitnonkernelfacility 2017-07-18 15:26:47 +02:00
Rainer Gerhards
c8a0d2bc1f maintain ChangeLog 2017-07-18 15:00:18 +02:00
Rainer Gerhards
eee25c5b51 Merge pull request #1647 from dsmith/var-type-ensure
Reset to VARTYPE_NONE
2017-07-18 14:57:42 +02:00
Rainer Gerhards
cbcc9a6d20 testbench: add test for very early startup messages
... and failures of getaddrinfo() when obtaining hostname.

This requires a number of testing LD_PRELOD libraries, which just
simulate system error. The actual test is rather small.

see also https://github.com/rsyslog/rsyslog/issues/1573
2017-07-18 14:50:09 +02:00
Rainer Gerhards
6d25833980 core bugfix: segfault after configuration errors
rsyslog will segfault on startup if
a) the local machine's hostname is set to a non-FQDN name
b) the getaddrinfo() system call fails
This scenario is higly unlikely, but may exist especially with
provisioned VMs which may not properly be able to do name queries
on startup (seen for example on AWS).

This patch fixes the situation and also provides more robustness
for very early startup error messages when some of the error-reporting
subsystem is not yet properly initialized. Note that under these
circumstances, errors may only show up on stderr.

closes https://github.com/rsyslog/rsyslog/issues/1573
2017-07-18 14:48:09 +02:00
Rainer Gerhards
36825174e1 maintain ChangeLog 2017-07-18 14:47:31 +02:00
Rainer Gerhards
231ab1d1cb Merge pull request #1669 from jgerhards/newdelimiter
imptcp: add parameter "multiline"
2017-07-18 14:45:04 +02:00
Rainer Gerhards
d46e138a68 Merge pull request #1671 from jgerhards/i1670
core: make rsyslog internal message rate-limiter configurable
2017-07-18 14:40:42 +02:00
Rainer Gerhards
84cb9eb066 Merge pull request #1657 from SirWumpus/imfile_count
Fix behaviour of PersistStateInterval.
2017-07-18 14:38:45 +02:00
Trent Piepho
5c35619385 imklog: Fix permitnonkernelfacility not working
permitnonkernelfacility doesn't work when the new configuration syntax
is used, e.g. 'module(load="imklog" permitnonkernelfacility="on")'.
It does work with the old syntax, e.g. '$KLogPermitNonKernelFacility
on'

This is because the old style config is stored in a static global
struct "cs", while the new style config is passed in as a pointer.
Code in imklog will put old style config entries into the new config
struct, and almost all the code in imklog uses the new config struct
like it should.  Except for a check for bPermitNonKernel in Syslog()
that continued to use the static global that only has old style
configs.

Fix this by passing pModConf down into Syslog() and using that in
place of the static global.

closes https://github.com/rsyslog/rsyslog/issues/477
2017-07-18 14:31:29 +02:00
Rainer Gerhards
23cffc823a Merge pull request #1666 from rgerhards/i-1665
omfwd: fixes and enhancements in udp forwarding
2017-07-18 14:24:49 +02:00
Rainer Gerhards
49561aca0a maintain ChangeLog 2017-07-17 16:05:18 +02:00
Rainer Gerhards
84ae4f6ff9 Merge pull request #1659 from rgerhards/i-1658
fix message garbling problem #1658
2017-07-17 16:01:21 +02:00
Jan Gerhards
ac9874cf49 core: make rsyslog internal message rate-limiter configurable
closes https://github.com/rsyslog/rsyslog/issues/1670
2017-07-16 13:34:09 +02:00
Jan Gerhards
250957d120 imptcp: add parameter "multiline"
experimental new functionality: modify octet-stuffed framing to
heuristically detect embedded newlines
2017-07-16 13:00:00 +02:00
Rainer Gerhards
8de60bf9c1 impstats: add new ressoure counter "openfiles"
closes https://github.com/rsyslog/rsyslog/issues/1661
2017-07-13 18:15:43 +02:00
Rainer Gerhards
4629566c3d code style: fix oversize lines 2017-07-12 15:35:45 +02:00
Rainer Gerhards
20c374b231 imudp: fix (cosmetic) unitialized data error 2017-07-12 14:43:00 +02:00
Rainer Gerhards
2401385a48 Merge branch 'i-1665-v8.25.0' into i-1655 2017-07-12 14:03:01 +02:00
Rainer Gerhards
35ae24c8a6 omfwd/udp: improve error reporting, depricate maxerrormessages parameter
Generally improved udp-related error messages (e.g. they now contain the
socket number, which makes it easier to related them to errors reported by
net.c subsystem).

We also depricated (removed) the "maxerrormessages" configuration parameters.
It provided some very rough rate-limiting capabilities and was introduced
before we had native rate-limiters. The default was that only the first 5
error messages were actually reported. For long-running instances, that
meant that in many cases no errors were ever reported. We now use the default
internal message rate limter, which works far better and ensures that also
long-running instances will be able to emit error messages after prolonged
runtime. In contrast, this also means that users will see more error
messages from rsyslog, but that should actually improve the end user
experience.
2017-07-12 13:55:11 +02:00
Rainer Gerhards
71d496533a core/net.c: improve UDP socket creation error messages 2017-07-12 13:38:27 +02:00
Rainer Gerhards
79032d68ca imudp: add "udp.sendbuf" parameter 2017-07-12 13:30:46 +02:00
Rainer Gerhards
fa860e01a0 omfwd/omudpspoof: switch udp client sockets to nonblocking mode
On very busy systems, we see "udp send error 11" inside the logs, and the requesting
action is being suspended (and later resumed). During the suspension period (in
default configuration), messages are lost. Error 11 translates to EAGAIN and the
cause of this problem is that the system is running out of UDP buffer space. This
can happen on very busy systems (with busy networks).

It is not an error per se. Doing a short wait will resolve the issue. The real root
cause of the issue is that omfwd uses a nonblocking socket for sending. If it were
blocking, the OS would block until the situation is resolved. The need for a
non-blocking sockets is a purely historical one. In the days of single-threaded
processing (pre v3), everything needed to be done by multiplexing, and blocking was
not permitted. Since then, the engine has dramatically changed. Actions now run on
their own thread(s). As such, there is no longer a hard need to use non-blocking i/o
for sending data. Many other output plugins also do blocking wait (e.g. omelasticsearch).
As such, the real root cause of the trouble is unnecessarily using non-blocking mode,
and consequently the right solution is to change that.

Note that using blocking i/o might change some timeing inside rsyslog, especially
during shutdown. So theoretical there is regression potential in that area. However,
the core is designed to handle that situation (e.g. there is special shutdown code to
handle the blocking case), so this does not stand against the "proper" solution.

This patch applies the change on the rsyslog core level, within net.c. The only
users of the changed functionality are omfwd and omudpspoof. Imudp is unaffected as
it requests server sockets.

Note that according to the sendto() man page, there is a second cause for the EAGAIN
error, this is when the system temporarily runs out of emphermeral ports. It is not
100% clear if this can also happen in the blocking case. However, if so, we can argue
this is a case where we really want the default retry logic. So for the time being,
it is appropriate to not handle EAGAIN in a special case any longer.

closes https://github.com/rsyslog/rsyslog/issues/1665
2017-07-12 13:18:49 +02:00
Rainer Gerhards
d9979cef22 testbench: add test for known message-garbling case
see also https://github.com/rsyslog/rsyslog/issues/1658
2017-07-12 08:29:06 +02:00
Rainer Gerhards
203b9b7d24 bugfix core: messsage garbled after message modification
The MsgDup() function will return a garbled message object under these conditions:
The message was originally created with message length equal or larger to CONF_RAWMSG_BUFSIZE.
This makes rsyslog store the message in dynamically allocated buffer space. Then,
a component reduces the message size to a size lower than CONGF_RAWMSG_BUFSIZE. A
frequent sample is the parser removing a known-bad LF at the end of the messages.
Then, MsgDup is executed. It checks the message size and finds that it is below
CONF_RAWMSG_BUFSIZE, which make it copy the msg object internal buffer instead
of the dynamically allocated one. That buffer was not written to in the first place, so
unitialized data is copied. Note that no segfault can happen, as the copied location was
properly allocated, just not used in this processing flow.

In the end result, the new message object contains garbage data. Whenever the new object
is used (e.g. in a async ruleset or action) that garbage will be used. Whenever the old
object is accessed, correct data will be used. Both types of access can happen inside
the same processing flow, which makes the problem appear to be random.

closes https://github.com/rsyslog/rsyslog/issues/1658
2017-07-11 11:01:50 +02:00
Anthony Howe
0b514add1c Fix behaviour of PersistStateInterval. If PersistStateInterval=1, then
each log line read should cause the state file to be updated, but this
was not happening because nRecords was being post-increment.
2017-07-10 14:32:47 -04:00
Derek Smith
3a93e5e377 type should be set back to VARTYPE_NONE incase we assigned a property type of VARTYPE_STRING while failing to grab the length value 2017-07-06 11:03:42 -07:00
Rainer Gerhards
451d5e15ca maintain ChangeLog 2017-07-03 10:20:05 +02:00
Rainer Gerhards
07e5da9f4b Merge pull request #1592 from rgerhards/i-1590
remove pre KSI-12 KSI components
2017-07-03 10:18:38 +02:00
Rainer Gerhards
b5096fa6ee ksi subsystem: remove no longer needed code
The KSI subsystem has been replaced by a newer Guardtime-provided
subsystem. Note that the old KSI subsystem does no longer work
to to Guardtime backend changes.

Libgt still continous to work.

closes https://github.com/rsyslog/rsyslog/issues/1590
2017-07-03 08:12:03 +02:00
Rainer Gerhards
d1f374c4a9 Merge pull request #1639 from PascalWithopf/enable-stylecheck
codestyle: enable stylecheck
2017-07-03 07:58:39 +02:00
PascalWithopf
2f40554acb codestyle: correct too long lines 2017-06-29 09:28:21 +02:00
Rainer Gerhards
6d5590ee8e Merge pull request #1638 from rgerhards/fix-kafka-ci-output
remove very verbose CI output in librdkafka install
2017-06-28 17:10:52 +02:00
PascalWithopf
27f65eee5e codestyle: enable stylecheck 2017-06-28 15:18:54 +02:00
Rainer Gerhards
657c6ea441 remove very verbose CI output in librdkafka install
was a left-over from debugging the kafka CI system;
spams stdout and thus can even lead to premature abort on
Travis due to too-large output
2017-06-28 12:23:01 +02:00
Rainer Gerhards
e9617cf5f2 bump version number for new development cycle 2017-06-27 16:07:28 +02:00
Rainer Gerhards
5f91d47283 prepare for 8.28.0 release v8.28.0 2017-06-27 15:40:40 +02:00
Rainer Gerhards
1d01bda48d maintain ChangeLog 2017-06-27 15:40:00 +02:00
Rainer Gerhards
48b80d3cc8 Merge pull request #1618 from infracaninophile/empty-argv
Empty argv
2017-06-27 15:37:55 +02:00
Rainer Gerhards
2ccdf61f24 Merge pull request #1637 from rgerhards/add-kafkafix
omkafka: Adding messages to failed list while doAction is in retry mode
2017-06-27 15:36:57 +02:00
Rainer Gerhards
b2d250139b maintain ChangeLog 2017-06-27 15:20:30 +02:00