440 Commits

Author SHA1 Message Date
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Rainer Gerhards
93546dba30 nitfix: clarify missing return state check
fixes a clang static analyzer warning
2015-12-05 18:59:40 +01:00
Rainer Gerhards
a2fd394f1f function return value was ignored
detected by clang static analyzer
2015-12-05 18:58:10 +01:00
Rainer Gerhards
625c6fde63 nitfix: theoretical NULL pointer access
but this code is currently not used, we even thing about
removing array passing mode

detected by clang static analyzer
2015-12-05 18:55:35 +01:00
Rainer Gerhards
7170118026 fix regression from #38b9532354d84c902ac7ed7bb734f673e4d613dc
(unreleased code)
The commit used debug coding, when --enable-rtinst was given, that
is not available in these functions (requires DEFiRet macro). That is
an old debug system which we need to reconsider anyways. So just do
not use it here.
2015-11-30 15:27:05 +01:00
Rainer Gerhards
bdb3f3e278 bugfix: potential race when new action worker is created
the wrkr instance table was not properly guarded.
2015-11-26 15:30:47 +01:00
Rainer Gerhards
0606c26492 Merge branch 'impstats-failcounter' of https://github.com/alorbach/rsyslog-1 into master-candidate 2015-07-14 14:12:44 +02:00
026f58ec99 impstats: Readded failed statscounter incrementation in Action Queue
proberly closes https://github.com/rsyslog/rsyslog/issues/395
Needs to be tested/verified
2015-07-02 06:38:08 -07:00
Michael Biebl
91b6954331 typo fix: paramter → parameter
Followup fix for 6fbacdc41d37ce3091709e71f6f0e66912237606
2015-06-30 18:07:09 +02:00
Rainer Gerhards
1d74c2509c bugfix: action.ExecOnlyWhenPreviousIsSuspended does not work correctly
The root cause of this problem was that the suspended state was
checked at the wrong spot. The state needs to be checked when
enqueueing, not on the consumer side -- because when we run on
an action queue, the state is always lost on the consumer side.

closes https://github.com/rsyslog/rsyslog/issues/375
2015-05-27 12:33:57 +02:00
Tomas Heinrich
1c46655412 bugfix: fix default action naming
The default name generated for an action references a global counter
instead of the action-specific number. In practice this means that the
number in the name will be greater by at least one than the assined
number most of the time.

NB: The code generating various action-related messages is using the
action name inconsistently; sometimes the generated name is used,
sometimes the action number is used, thus producing "action N" or
"action N+1" identifiers at different locations in the code.
2015-05-18 15:54:40 +02:00
Rainer Gerhards
31f529fb45 build regression: build fails on some platforms due to recent merge
some platforms are extra-strict about C syntax, so let's clean
this up before trouble shows up.
2015-04-30 11:33:05 +02:00
Janmejay Singh
2808d4805e Fixed race-condition in async-action that is to consume mutating messages (it optionally allows message to be copied, rather than just reffered-to, so async-queue has a copy which does not change). It is an optional-param, defaulted to current behaviour of not copying.
This is not required for 'call <ruleset>' statements, because they already copy message.

As of now, this is relevant when foreach feeds messages to an async-action.
2015-04-14 11:15:14 +05:30
Rainer Gerhards
09522af762 action: refactor worker instance table handling 2015-03-31 17:28:53 +02:00
Rainer Gerhards
ca3f961671 core engine: plugin IF extension to support wrkr-level HUP processing 2015-03-30 15:10:13 +02:00
Rainer Gerhards
24d5d6a758 core engine: plumbing to support wrkr-level HUP processing
This implements some plumbing to keep track of the wrkr data
pointers so that they are easily enough accessible during HUP
processing.

see also https://github.com/rsyslog/rsyslog/issues/281
2015-03-30 15:10:13 +02:00
Rainer Gerhards
db2ceea663 bugfix: large memory consumption on suspended action
When an action is suspended, rsyslog's memory consumption continues
to grow. On very busy systems, this can lead to system stability
errors as it is possible that rsyslog allocates too much memory.

The root cause of this issue is the invalid management of a string
cache index, which is reset to the beginning in the wrong function,
one that is not reached when suspended. This in turn leads to
continous increase of the cache.

This fix moves the reset to the proper location.

Note that this problem was not detectable by our valgrind tests
because proper cleanup was done on rsyslog termination (but only
then).

closes https://github.com/rsyslog/rsyslog/issues/253
2015-02-26 09:48:27 +01:00
Rainer Gerhards
f8947d9d51 bugfix: action resumption was reported with invalid code
... which also caused inconsistencies in erorr message tags
2015-01-06 15:43:51 +01:00
Rainer Gerhards
423c3ac62c pstats: add "origin" paramter to stats records
see also: https://github.com/rsyslog/rsyslog/issues/119
2014-11-19 15:49:09 +01:00
Rainer Gerhards
ad0ec3f96a slightly improved error message 2014-07-22 11:11:09 +02:00
Rainer Gerhards
0439592567 Merge branch 'v7-stable' into v8-stable 2014-07-11 12:56:21 +02:00
Rainer Gerhards
e61d8a88d0 Merge branch 'v7-stable' of git+ssh://git.adiscon.com/git/rsyslog into v7-stable 2014-07-11 12:47:23 +02:00
Rainer Gerhards
df2d8de8c4 fix inconsistent write/deref in action config processing
Thanks to Tomas Heinrich for alerting us.
2014-07-11 12:46:56 +02:00
Rainer Gerhards
ff4213524c Merge branch 'v7-stable' into v8-stable
Conflicts:
	action.c
2014-07-11 12:19:41 +02:00
Rainer Gerhards
089a7ba9f2 unpick commit 5c4cb78ac15e841726af672a8a227017a2516cfa
The variable initialized there was removed by my larger patch
a couple of days ago. Accidently cherry-picked that commit.
2014-07-11 11:53:16 +02:00
Tomas Heinrich
1267ee2879 Set default value of eParamPassing explicitly 2014-07-11 11:50:27 +02:00
Tomas Heinrich
ba4cc3298c bugfix: add a missing flag and prevent memleak 2014-07-11 11:49:22 +02:00
Tomas Heinrich
b43b16901e bugfix: correct variable mismatch 2014-07-11 11:49:22 +02:00
Tomas Heinrich
28277f723e bugfix: don't export uninitialized data 2014-07-11 11:49:22 +02:00
Tomas Heinrich
dcb201eae6 bugfix: remove duplicate code 2014-07-11 11:49:22 +02:00
Rainer Gerhards
15c051dfb6 Merge branch 'v7-stable' into v8-stable 2014-07-11 09:27:58 +02:00
Rainer Gerhards
499b3c7426 fix small memleak in action()
This was introduced by a recent patch. Not present in any
released version.
2014-07-11 09:27:30 +02:00
Rainer Gerhards
62c26362b3 Merge branch 'v7-stable' into v8-stable
Conflicts:
	action.c

I needed to adopt the v7 changes to the new non-batch inner
processing. This may have some bug potential.
2014-07-10 19:42:57 +02:00
Rainer Gerhards
cda27324b8 bugfix: output modules with parameters with multiple passing modes could cause strange behaviour including aborts
This was due to the fact that the action module only preserved and
processed the last set passing mode. Note that this was not a problem
for the plugins provided by the rsyslog git: none of them uses different
passing modes.
Thanks to Tomas Heinrich for providing a very detailled bug report.
2014-07-06 17:48:30 +02:00
Rainer Gerhards
30c8c4bdb1 Merge branch 'v7-stable' into master-merge
This was a rather complicated merge as we needed to migrate some
per-action settings (v7) to action instance settings (v8).

Conflicts:
	action.c
	action.h
	doc/global.html
	runtime/glbl.c
2014-03-03 15:49:01 +01:00
Rainer Gerhards
1b29f59615 add global and action-parameter action.reportSuspensionContinuation 2014-03-01 11:30:04 +01:00
Rainer Gerhards
142332e227 bugfix: invalid error number was logged 2014-02-28 14:09:40 +01:00
Rainer Gerhards
2ed88403e8 emit "action resumed" message only when the resume was actually successful 2014-02-28 12:59:07 +01:00
Rainer Gerhards
9830565917 Merge branch 'v7-stable' into master-upmerge
Conflicts:
	action.c
	action.h
2014-02-27 18:42:30 +01:00
Rainer Gerhards
fa5f2aab10 added "action.reportSuspension" action parameter
This now permits to control handling on a per-action basis rather to
the previous "global setting only".
2014-02-27 18:32:13 +01:00
Rainer Gerhards
6f2be18a3c Merge branch 'v7-stable'
Conflicts:
	action.h
2014-02-23 12:22:28 +01:00
Rainer Gerhards
738e58dcf6 bugfix: "action xxx suspended" did report incorrect error code 2014-02-23 12:18:02 +01:00
Rainer Gerhards
87c639fb93 "action resumed" message now also specifies module type
which makes troubleshooting a bit easier. Note that we cannot output all
the config details (like destination etc) as this would require much more
elaborate code changes, which we at least do not like to do in the
stable version.
2014-02-23 12:13:20 +01:00
Rainer Gerhards
28b7608b82 better and more consistent action object naming
action queues now always contain the word "queue" after the action name
2014-02-23 11:46:36 +01:00
Rainer Gerhards
3c70cf1dd9 bugfix: end of batch processing was not 100% correct.
Could lead to outputs not properly wirting messages. At least
omelasticsearch did not write anything to the database due to this bug.
See: https://github.com/rsyslog/rsyslog/issues/10
Thanks to Radu Gheorghe for reporting the issue.
2014-02-19 14:48:34 +01:00
Rainer Gerhards
09313132ee cleanup 2013-12-07 18:50:57 +01:00
Rainer Gerhards
61afef5522 properly handle suspension in commitTransaction() processing 2013-12-07 18:49:03 +01:00
Rainer Gerhards
bd74a861fe cosmetic: remove already done TODO 2013-12-07 17:47:23 +01:00
Rainer Gerhards
3f18e9366f bugfix: action commitTransaction() processing did not properly handle suspended actions 2013-12-07 17:31:51 +01:00
Rainer Gerhards
15c8faa726 refactor: remove duplicate code 2013-12-06 11:07:32 +01:00