107 Commits

Author SHA1 Message Date
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
Rainer Gerhards
4b150db338 milestone: module() config statement basically works
some nits to iron out, only omfile actually support module params
2012-06-21 16:19:20 +02:00
Rainer Gerhards
3fe6365166 refactor: remove very old sync.[ch] system for "abstracting" mutex access
This was a bad idea that never was used much.
2012-01-19 15:24:16 +01:00
Rainer Gerhards
ac9afc4149 Merge branch 'v5-stable' into master
Conflicts:
	ChangeLog
	action.h
	configure.ac
	doc/manual.html
	plugins/immark/immark.c
	plugins/impstats/impstats.c
	plugins/imptcp/imptcp.c
	plugins/imtcp/imtcp.c
	runtime/cfsysline.c
	runtime/cfsysline.h
	runtime/conf.c
	runtime/ctok.c
	runtime/ctok.h
	runtime/ctok_token.c
	runtime/ctok_token.h
	runtime/dnscache.h
	runtime/expr.c
	runtime/expr.h
	runtime/rule.c
	runtime/rule.h
	runtime/ruleset.h
	runtime/sysvar.c
	runtime/vm.h
	runtime/vmop.c
	runtime/vmop.h
	runtime/vmprg.c
	runtime/vmprg.h
	runtime/vmstk.c
	runtime/vmstk.h
	tools/omusrmsg.c
2012-01-18 14:08:24 +01:00
Rainer Gerhards
0871d0a077 Merge branch 'v4-stable' into v5-stable
Conflicts:
	plugins/imfile/imfile.c
	plugins/omtesting/omtesting.c
	tcpsrv.c
	threads.c
2012-01-14 18:32:40 +01:00
Rainer Gerhards
0862e839b6 some more files to ASL 2.0 2012-01-11 18:49:00 +01:00
Rainer Gerhards
00d2ac3d71 Merge branch 'v5-devel'
Conflicts:
	ChangeLog
	action.c
	plugins/imudp/imudp.c
2011-12-19 17:30:43 +01:00
Rainer Gerhards
7837c523b8 additional counter for lost messages due to failed actions added 2011-12-19 12:34:19 +01:00
Rainer Gerhards
5fe837bf7d added instrumentation 2011-12-19 11:16:07 +01:00
Rainer Gerhards
a8122314f9 milestone: generic action parameters parsed via new config system 2011-08-01 13:15:47 +02:00