116 Commits

Author SHA1 Message Date
Rainer Gerhards
62e2e059ca
action: add "action.resumeIntervalMax" parameter
This parameter permits to set an upper limit on the growth of the
retry interval. This is most useful when a target has extended
outage, in which case retries can happen very infrequently.

closes https://github.com/rsyslog/rsyslog/issues/3401
2019-01-10 11:37:26 +01:00
Rainer Gerhards
223c03e536
cleanup: remove commented-out code
thanks to lgtm.com for the ability to detect commented out code!
2018-10-27 19:04:30 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
c1a601e72f core/action: implement errorfile capability
in case an action needs to discard messages, these discarded
messages can now be written to an "error file" if so configured.
This permits to detect, diagnose and re-process failed messages.

closes https://github.com/rsyslog/rsyslog/issues/1836
2018-01-06 11:25:13 +01:00
Rainer Gerhards
ce1f36861d action bugfix: bHadAutoCommit handled in thread-unsafe way
This internal state was improperly handled and most probably caused
(hard to see) issues when action instances were run on multiple worker
threads. It looks like the state variable was forgotten to move over
to worker state when action workers were introduced. This patch
fixes that.

closes https://github.com/rsyslog/rsyslog/issues/2046
2017-12-30 12:41:25 +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
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Janmejay Singh
671989350e fixed a few memory leaks and covered omprog cleanup with valgrind (one of the leaks affects any non-tx string-passing action) 2016-11-03 23:48:43 +05:30
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
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
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
c2c8c26c87 Merge branch 'v7-stable' into v8-stable
Conflicts:
	plugins/imfile/imfile.c
2014-07-13 13:07:08 +02:00
Rainer Gerhards
6d668c915f cosmetic: fix some gcc --pedantic messages 2014-07-13 12:43:07 +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
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
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
a16113442e cleanup 2013-12-03 15:06:49 +01:00
Rainer Gerhards
9cc097832b failed action detection more precisely for a number of actions
If an action  uses string parameter passing but is non-transactional
it can be executed immediately, giving a quicker indicatio of
action failure.
2013-12-03 10:20:45 +01:00
Rainer Gerhards
c4501ebb52 Merge branch 'v7-devel' into tmp
Conflicts:
	action.c
2013-11-29 16:59:19 +01:00
Rainer Gerhards
8bf869fafb actions now report if they suspend and resume themselves 2013-11-29 15:43:23 +01:00
Rainer Gerhards
c3d80cd3b0 add new impstats action counters:
* suspended
  * suspended.duration
  * resumed
2013-11-29 15:13:22 +01:00
Rainer Gerhards
2a94703425 refactor action disabling 2013-11-06 12:24:49 +01:00
Rainer Gerhards
1e20ff6b71 enforce that actions can no longer "do something" on action creation
This doesn't play well with config load/priv drop and was not strictly
enforced in v7.
2013-11-06 11:50:27 +01:00
Rainer Gerhards
1142083565 refactor: move pbShutdownImmediate to wti_t 2013-11-05 08:59:42 +01:00
Rainer Gerhards
9718fbbf0b push bShutdownImmediate ptr down to commit process 2013-11-04 14:42:15 +01:00
Rainer Gerhards
ce57131e1e experimentally split ruleset execution in exec and commit phase 2013-11-04 14:32:49 +01:00
Rainer Gerhards
b278457d49 refactor: move batch "unrolling" up one layer 2013-11-04 09:12:56 +01:00
Rainer Gerhards
fbfc398463 refactor: move action resume retry counter to wti_t 2013-11-01 18:17:30 +01:00
Rainer Gerhards
8c46d71293 refactor: move handling too-frequent tryResume == OK to wti_t 2013-11-01 17:34:38 +01:00
Rainer Gerhards
bf11ace45a refactor: move action state to wti (as we are now on a per-thread basis) 2013-11-01 17:22:32 +01:00
Rainer Gerhards
5878ee24c7 milestone: action mutex removed
This means actions may now be called concurrently and must make
provisions themselves to handle multi-threading.
2013-10-29 17:19:15 +01:00
Rainer Gerhards
1f59e66eef milestone: calling sequence changed so that wti is passed to many functions 2013-10-26 17:56:04 +02:00
Rainer Gerhards
efa8dfb47d maintain action ids (actionNbr) 2013-10-26 13:54:45 +02:00
Rainer Gerhards
415b26d5a1 enable shuffling of crypto parameters down through queue definition 2013-05-10 15:39:42 +02:00
Rainer Gerhards
8339d54ddc optimize: do date() call in template processing only if actually needed 2013-01-13 14:40:17 +01:00
Rainer Gerhards
feddb2cc8f queue: change gerenic queue pUsr ptr to be action_t
this was always action_t, but the initial design was more generic. We are
making it specific now in order to gain better performance (after all, we
did not need the generic engine in the past 8 years...)
2012-11-03 11:40:13 +01:00
Rainer Gerhards
3d41da36b8 remove "last message repeated n times" from rsyslog output part 2012-10-23 11:22:56 +02:00
Rainer Gerhards
f85690620b do "template date call" only when actually needed 2012-10-11 09:12:20 +02:00
Rainer Gerhards
a85784a480 Merge branch 'v6-stable' into v6-devel 2012-09-19 18:57:24 +02:00
Rainer Gerhards
b40c83090e bugfix: potential abort, if action queue could not be properly started
This most importantly could happen due to configuration errors.
2012-09-19 18:57:02 +02:00
Rainer Gerhards
901270418e add OMSR_TPL_AS_JSON mode for output modules (interface only)
This patch does NOT contain any implementation, this will happen
next. Thanks to Miloslav Trmac, who suggested a similar mode, which
I based the JSON idea on.
2012-08-29 09:56:49 +02:00
Rainer Gerhards
8e8b77c7ef Merge branch 'beta' into master-module
Conflicts:
	ChangeLog
	configure.ac
	plugins/imklog/imklog.c
	plugins/imklog/imklog.h
2012-06-29 12:54:49 +02:00
Rainer Gerhards
6812fceef4 cleanup: remove config scoping system left-over
this was an experiment in early v6 that did not work out. I forgot to
remove this code when I undid it.
2012-06-27 12:01:08 +02:00