71 Commits

Author SHA1 Message Date
Michael Biebl
6569133c75
Typo fixes (#4801)
* typo fix: ambigious -> ambiguous

* typo fix: aquire -> acquire

* typo fix: assgined -> assigned

* typo fix: cancelation -> cancellation

* typo fix: childs -> children

* typo fix: configuraton -> configuration

* typo fix: delemiter -> delimiter

* typo fix: forwardig -> forwarding

* typo fix: initializiation -> initialization

* typo fix: intializing -> initializing

* typo fix: lengh -> length

* typo fix: mesage -> message

* typo fix: occured -> occurred

* typo fix: occurence -> occurrence

* typo fix: paramter -> parameter

* typo fix: remaing -> remaining

* typo fix: resetted -> reset

* typo fix: suppored -> supported

* typo fix: Sytem -> System

* typo fix: uncommited -> uncommitted

* typo fix: depricated -> deprecated

* typo fix: stoping -> stopping

* type fix: allow to -> allow one to
2022-02-17 10:54:12 +01:00
Rainer Gerhards
8c8e1e92d0
queue: add support for minimum batch sizes
closes https://github.com/rsyslog/rsyslog/issues/495
2019-01-18 17:34:55 +01:00
Rainer Gerhards
ace6494870
core/wti: changed worker thread termination handling
while we solved valgrind false positives during shutdown in
2700badfda76c701fa9169c31c9ec4f7993dc0b8, we continue to see
related messages for thread-local-storages. Rather than suppressing
these as well we now refactored the code so that it does not use
detached threads.

This shall improve robustness. In case it does not, we have enhanced
debug messages under CI runs, so potentially still-existing problem
areas should be easier to diagnose.

see also https://github.com/rsyslog/rsyslog/issues/2902
2018-11-12 11:33:56 +01:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
04bd333593 core: improve queue status reporting on shutdown
The last commit (yesterday) did not properly convey when we actually
needed to cancel a thread. This commit corrects this and also
provides better information on the actual cancel operation and
some tipps for the user on how to solve it (timeout mentioned).
2017-12-31 17:30:58 +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
Rainer Gerhards
1d7e772088 core: replace some inline functions by macros
I consider the C99 semantics to be pretty broken. Rather than
duplicating code for the inline variant and the non-inline one,
I replace the functions in question by macros. We do not loose
much in terms of type-safety.

see also https://github.com/rsyslog/rsyslog/pull/2246
2017-12-18 12:40:34 +01:00
Rainer Gerhards
ce06bba15c RainerScript: implement previous_action_suspended() function
This function returns a boolean indicating if the previous action is
suspended (0 - no, 1 - yes). This is useful if arbitrary processing
(other than calling actions) should be made depending on that state.
A prime example for this is probably calling a ruleset.

closes https://github.com/rsyslog/rsyslog/issues/1939
2017-12-09 17:48:28 +01:00
Rainer Gerhards
b63d3051bc RainerScript: add function script_error() and error-reporting support
This permits script functions that could fail to report errors back, so
that the user can handle them if desired. We use an errno-style of
interface. That means script_error() needs to be called after functions
that supports it. It will return either 0 (all OK) or something else
(an error condition).

The commit also modifies the parse_time() function to use the new
interface. First of all, this is useful for users, and secondly we
needed a capability to craft a testbench test.

closes https://github.com/rsyslog/rsyslog/issues/1978
2017-12-09 16:08:36 +01:00
Rainer Gerhards
3701e7ec91 core/wrkr threads: fix race condition
During e.g. shutdown it could happen that a worker thread was started
and immediately be requested to terminate. In such situations there was
a race the prevented proper initialization. This could lead to follow-on
problems.

We believe (but could not proof) that this also could lead to a hang of
the termination process. Thus we claim to close an issue tracker down
here below, but are not 100% certain it really closes it (we hope for
user feedback on this). In any case, the thread debuger showed invalid
operations and this has been fixed, so it is useful in any case.

closes https://github.com/rsyslog/rsyslog/issues/1959
2017-11-10 19:03:09 +01:00
Rainer Gerhards
71b0922c22 action handler: detected and handle DATAFAIL error during action processing 2017-10-12 13:26:10 +02:00
Rainer Gerhards
149c23368b action bugfix: no "action suspended" message during retry processing
The action engine does not emit "action suspended" messages but "resumed"
ones in retry processing. This is wrong, as they are a strong indication
that something does not work correctly. Nevertheless, "resumed" messages
were emitted, which was very puzzling for the user.

This patch fixes it so that "suspend" messages are given during retry
processing. These do not contain a retry timestamp, providing evidence
that a retry is currently being tried.

closes https://github.com/rsyslog/rsyslog/issues/1069
2017-10-12 13:26:10 +02:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
51c03c66e0 make inline functions C99-compliant
As it seems, different C compilers have different rules/interpretations
on inline functions. The current code base did not properly obey all C99
rules. We fix this by converting some functions to macros and others to
include the necessary C99 plumbing. We also remove some inline attributes
for functions where this seems to be to agressive (aka "function to big").

This fixes build problems in some environments and is a general code
cleanup measure.
2016-09-05 16:47:14 +02:00
Rainer Gerhards
7c52a118c9 fix missing includes causing build issues
I wonder why this did not come up earlier...
2016-08-22 18:17:40 +02:00
Rainer Gerhards
fe4fb59647 wti object: fix cosmetic memory leak
This "leak" happes only immediately before shutdown, so it is not
a real leak. But it can get in our way when working with memory
debuggers.
2016-04-23 18:09:36 +02:00
Rainer Gerhards
bbd0f01438 remove a couple of gcc --pedantic messages 2014-08-19 16:55:33 +02:00
Rainer Gerhards
8b326647d2 cleanup 2014-05-28 11:54:23 +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
aa43e15a57 fix merge problems (interfaces have changed) 2013-12-19 17:12:47 +01:00
Rainer Gerhards
21d265bd84 regression fix: another address miscalculation fixed 2013-12-05 07:58:56 +01:00
Rainer Gerhards
a0d682ec1d fix memory adressing error in refactored code 2013-12-04 17:17:45 +01:00
Rainer Gerhards
4695ab7c3e refactor output system string handling 2013-12-04 16:49:22 +01:00
Rainer Gerhards
89df439930 more or less cosmetic 2013-12-04 13:02:50 +01:00
Rainer Gerhards
fb6dd02afc refactor milestone: create first PoC of commitTransaction() entry point 2013-12-04 11:38:07 +01:00
Rainer Gerhards
41a3489b70 refactor milestone: prep iparam structure for omod interface usage 2013-12-04 10:29:13 +01:00
Rainer Gerhards
be36ef5009 refactor doAction omod interface
we do no longer support the iMsgOpts parameter
2013-12-04 09:24:11 +01:00
Rainer Gerhards
140b5b22c0 cleanup/beautify 2013-12-03 18:57:05 +01:00
Rainer Gerhards
3b523a196a reduced number of malloc/frees during string template processing
We now re-use once allocated string template memory for as long
as the worker thread exists. This saves us from doing new memory
allocs (and their free counterpart) when the next message is
processed. The drawback is that the cache always is the size of
the so-far largest message processed. This is not considered a
problem, as in any case a single messages' memory footprint should
be far lower than that of a whole set of messages (especially on
busy servers).
2013-12-03 17:03:22 +01:00
Rainer Gerhards
a16113442e cleanup 2013-12-03 15:06:49 +01:00
Rainer Gerhards
6bd98320a4 another round of const qualifiers 2013-12-03 14:24:30 +01:00
Rainer Gerhards
dc84772973 refactor: shrink template string structures 2013-12-03 14:10:51 +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
23278699e3 Merge branch 'master-ruleeng' into master-ruleeng-simd 2013-11-07 12:57:49 +01:00
Rainer Gerhards
fb81cf202c Merge branch 'master' into master-ruleeng
Conflicts:
	runtime/wti.c
	runtime/wti.h
2013-11-07 12:57:36 +01:00
Pavel Levshin
772cba6f2e improve worker thread pool handling
among others, make possible that workers really timeout and the pool
thus shrinks
2013-11-06 18:37:47 +01:00
Rainer Gerhards
e3dc604142 refactor iparams to use array
this is also prep work for a single doTransaction() output mode api
2013-11-06 18:07:26 +01:00
Rainer Gerhards
2a94703425 refactor action disabling 2013-11-06 12:24:49 +01:00
Rainer Gerhards
176dea7654 make batches of 1 commit automatically after each action
This improves failover handling and makes it consistent with doc
(precise handling for batches of one).
2013-11-06 11:28:44 +01:00
Rainer Gerhards
08c262011d re-enable bPrevWasSuspended handling 2013-11-06 11:06:48 +01:00
Rainer Gerhards
e51de9f416 re-enable main queue direct mode 2013-11-05 17:47:35 +01:00
Rainer Gerhards
1142083565 refactor: move pbShutdownImmediate to wti_t 2013-11-05 08:59:42 +01:00
Rainer Gerhards
ce57131e1e experimentally split ruleset execution in exec and commit phase 2013-11-04 14:32:49 +01:00
Rainer Gerhards
08e96b620e refactor output side of action queue - main shot
this needs refinement, but basically we now do no longer rely on
batches for the sub-functions.
2013-11-02 12:04:33 +01:00
Rainer Gerhards
fbfc398463 refactor: move action resume retry counter to wti_t 2013-11-01 18:17:30 +01:00
Rainer Gerhards
7c74c432a7 some debug aids & useful commments for going forward 2013-11-01 18:06:58 +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
4ac27e73af call freeWrkrInstance() on worker thread termination 2013-10-29 18:16:57 +01:00
Rainer Gerhards
efa8dfb47d maintain action ids (actionNbr) 2013-10-26 13:54:45 +02:00