123 Commits

Author SHA1 Message Date
Rainer Gerhards
149bab9cd1 cosmetic: removed left-over debug message 2010-04-26 15:55:33 +02:00
Rainer Gerhards
eec894fbc5 bugfix(kind of): output plugin retry behaviour could cause engine to loop
The rsyslog engine did not guard itself against output modules that do
not properly convey back the tryResume() behaviour. This then leads to
what looks like an endless loop. I consider this to be a bug of the
engine not only because it should be hardened against plugin misbehaviour,
but also because plugins may not be totally able to avoid this situation
(depending on the type of and processing done by the plugin).
2010-04-26 15:19:13 +02:00
Rainer Gerhards
8b9cef552d Merge branch 'v4-stable' into v5-stable
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	runtime/debug.c
	runtime/stream.c
	tests/Makefile.am
	tests/diskqueue.sh
	tests/nettester.c
	tools/omfile.c
2010-03-29 11:07:15 +02:00
Rainer Gerhards
f8dee56243 bugfix: potential re-use of free()ed file stream object in omfile
when dynaCache is enabled, the cache is full, a new entry needs to
be allocated, thus the LRU discarded, then a new entry is opend and that
fails. In that case, it looks like the discarded stream may be reused
improperly (based on code analysis, test case and confirmation pending)
2010-03-23 14:11:50 +01:00
Rainer Gerhards
074ec9495e backporting bugfixes from 5.2.2
- bugfix: queues in direct mode could case a segfault, especially if an
  action failed for action queues. The issue was an invalid increment of
  a stack-based pointer which lead to destruction of the stack frame and
  thus a segfault on function return.
  Thanks to Michael Biebl for alerting us on this problem.
  [backport from 5.5.2]
- bugfix: wrong memory assignment for a config variable (probably
  without causing any harm) [backport from 5.2.2]
2010-01-27 09:52:15 +01:00
Rainer Gerhards
d3592db45b bugfix: ompgsql did not properly check the server connection in tryResume()
what could lead to rsyslog running in a thight loop.
Also did some code cleanup of previous patch.
2009-12-16 16:21:52 +01:00
Rainer Gerhards
b61be5dcca bugfix: error during beginTransaction() was not properly handled
Suspension during beginTransaction() did not properly cause the action
to be suspended, thus we entered an endless loop.
2009-12-16 15:30:45 +01:00
Rainer Gerhards
e5fe270bdb bugfix: commit transaction was not properly conveyed to message layer,
potentially resulting in non-message destruction and thus hangs
2009-11-26 17:30:58 +01:00
Rainer Gerhards
8b246de2a5 some light performance enhancement
...by replacing time() call with much faster (at least under linux)
gettimeofday() calls.
2009-11-12 17:12:10 +01:00
Rainer Gerhards
adab485b93 Merge branch 'v4-devel'
Conflicts:
	tests/Makefile.am
2009-11-12 13:36:29 +01:00
Rainer Gerhards
0fd8143d87 Merge branch 'v4-stable' into v4-beta
Conflicts:
	tests/Makefile.am
2009-11-12 13:21:46 +01:00
Rainer Gerhards
0a5b731f2f bugfix: $ActionExecOnlyOnceEveryInterval did not work.
This was a regression from the time() optimizations done in v4.
Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=143
Thanks to Klaus Tachtler for reporting this bug.
2009-11-12 13:14:39 +01:00
Rainer Gerhards
2dafb35077 some module cleanup 2009-11-12 12:03:27 +01:00
Rainer Gerhards
1b7f5c5468 moved rfc3164/5424 code to new parser modules
another milestone commit: the program works, the new interface
is used, some more cleanup is needed and the per-ruleset config
options are still missing. But we are getting closer...
2009-11-04 10:40:27 +01:00
Rainer Gerhards
05d693123b added omruleset output module, which provides great flexibility in action processing.
THIS IS A VERY IMPORTANT ADDITION, see its doc for why.
2009-11-02 11:39:38 +01:00
Rainer Gerhards
f3134f8921 some more cleanup - action config line handlers are now defined in action.c
As an artifact of early development, they were registered in syslogd.c
2009-10-27 15:16:10 +01:00
Rainer Gerhards
6cf7fc7ec2 action processing optimized for queue shutdown 2009-10-27 13:53:45 +01:00
Rainer Gerhards
33e216daf7 Begun to work on partial batch deletes...
... but this brings a lot of problems with it. The issue is that
we still have a sequential store and we do not know how we could
delete the one entry right in the middle of processing. I keep this
branch if we intend to move on with it - but for now I look into a
different solution...
2009-10-22 14:57:34 +02:00
Rainer Gerhards
90e8475260 bugfix: message processing states were not set correctly in all cases
however, this had no negative effect, as the message processing state
was not evaluated when a batch was deleted, and that was the only case
where the state could be wrong.
2009-10-19 09:41:45 +02:00
Rainer Gerhards
c5408da3d8 new queue engine - initial commit (probably not 100% working!)
simplified and thus speeded up the queue engine, also fixed some
potential race conditions (in very unusual shutdown conditions)
along the way. The threading model has seriously changes, so there may
be some regressions.

NOTE: the code passed basic tests, but there is still more work
and testing to be done. This commit should be treated with care.
2009-10-14 11:01:21 +02:00
Rainer Gerhards
4d70c9b3e5 added some debug settings plus improved shutdown sequence
... non-working version!
2009-10-13 14:38:45 +02:00
Rainer Gerhards
6e1f0d4f70 minor: optimized dbgprintf() calling sequence 2009-09-10 15:29:22 +02:00
Rainer Gerhards
eb70428681 minor: optimized dbgprintf() use 2009-09-10 13:56:08 +02:00
Rainer Gerhards
d1b092da1e reduced number of debug messages a bit again 2009-08-26 15:44:36 +02:00
Rainer Gerhards
c7f746d834 added new config option $ActionWriteAllMarkMessages
this option permites to process mark messages under all circumstances,
even if an action was recently called. This can be useful to use mark
messages as a kind of heartbeat.
2009-08-20 12:52:33 +02:00
Rainer Gerhards
a6bda9b93f bugfix: discard action did not work (did not discard messages) 2009-07-30 11:09:15 +02:00
Rainer Gerhards
183b490155 more code simplification, should also bring some performance enhancement
reducing the number of thread cancellation state changes
2009-07-17 12:38:49 +02:00
Rainer Gerhards
4130ca8670 Merge branch 'v4-devel' 2009-07-09 17:21:01 +02:00
Rainer Gerhards
6fde78cb74 small performance improvement and cleanup
optimized substring processing, should bring a small enhancement when
forwarding with the default forwarding templates. Also did some uchar
cleanup in msg.c (thus so many changes, in reality they are few...).
2009-07-09 17:19:21 +02:00
Rainer Gerhards
d22f240bc3 Merge branch 'master' into v5-devel 2009-06-26 14:09:15 +02:00
Rainer Gerhards
d88803c8e4 got rid of the recursive requirement for msg_t mutex (finally!) 2009-06-26 13:42:52 +02:00
Rainer Gerhards
11172b62b0 quick and dirty fix for one race condition
It is intentionally quick & dirty, as I would like to do some
better patch, if possible. For that, I probably need the commented-out
code, thus no delete.
2009-06-24 15:05:13 +02:00
Rainer Gerhards
539f33c6a0 bugfix: abort when using multiple mainMsgQueue worker threads
this bug was introduced by a recent change which was a bit too agressive
in avoiding locking. We can probably do better than with this patch, but
I think I'll move that into the v5 engine.
2009-06-24 11:40:53 +02:00
Rainer Gerhards
c53ca3a234 fixed a race condition: generated msg string store must be mutex protected
the string area that is used to build the string being passed to
the output module is now part of the action structure. As such,
access to it must also be guarded by the action mutex (an even more
optimal solution may be to store it in thread-local storage, but
there always must remain some room for improvement ;)).
2009-06-23 18:23:02 +02:00
Rainer Gerhards
a3e512f65f Merge branch 'omfile' into v5-devel
Conflicts:
	runtime/rsyslog.h
2009-06-23 17:23:28 +02:00
Rainer Gerhards
b50d13a6a9 restored repeated message reduction processing 2009-06-23 14:50:03 +02:00
Rainer Gerhards
5defa14fed some post-merge cleanup 2009-06-22 15:32:01 +02:00
Rainer Gerhards
651bee9cf5 Merge branch 'omfile' into tmp
This was a complex manual merge, especially in action.c. So if
there occur some problems, this would be a good point to start
troubleshooting. I run a couple of tests before commiting and
they all went well.

Conflicts:
	action.c
	action.h
	runtime/queue.c
	runtime/queue.h
	runtime/wti.c
	runtime/wti.h
2009-06-22 15:12:35 +02:00
Rainer Gerhards
3abf567d2b optimized template string generation 2009-06-19 16:07:17 +02:00
Rainer Gerhards
cbad28915a optimized action.c a bit 2009-06-19 12:39:06 +02:00
Rainer Gerhards
2de4964aff optimized handling of MSG part in msg object
WARNING: currently, message repeation processing is disabled, must
be reenabled (but prefer to do some other tests first)
2009-06-18 16:51:40 +02:00
Rainer Gerhards
8628312396 cleaned up/optimized raw message handling in msg object 2009-06-18 13:22:21 +02:00
Rainer Gerhards
b5f3387357 Merge branch 'omfile' into v5-devel
Note that this was NOT a trivial merge, and there may be
some issues. This needs to be seen when we continue developing.

Conflicts:
	runtime/msg.h
	runtime/obj.h
	runtime/queue.c
	runtime/srUtils.h
	runtime/stream.c
	runtime/stream.h
	runtime/wti.c
	tests/Makefile.am
	tools/omfile.c
	tools/syslogd.c
2009-06-16 13:59:09 +02:00
Rainer Gerhards
9704f129f7 added capability to fsync() queue disk files for enhanced reliability
also adds speed, because you do no longer need to run the whole file
system in sync mode. New testbench and new config directives:
- $MainMsgQueueSyncQueueFiles
- $ActionQueueSyncQueueFiles
2009-06-09 19:00:18 +02:00
Rainer Gerhards
4a8c02870a moved user object destruction to queue itself
So far, the consumer was responsible for destroying objects. However, this
does not work well with ultra-reliable queues. This is the first move to
support them.
2009-05-13 16:00:15 +02:00
Rainer Gerhards
e2b2298689 action batch processing implemented
... passed initial tests, but of course more are needed
2009-05-12 17:57:04 +02:00
Rainer Gerhards
bb79e96dc3 moving to a cleaner implementation of batches
... now that we know what we need from a theoretical POV.
2009-05-12 15:27:40 +02:00
Rainer Gerhards
21b7f7e603 Merge branch 'master' into multi-dequeue
Conflicts:
	runtime/rsyslog.h
2009-05-12 09:18:04 +02:00
Rainer Gerhards
8e430258fd added capability to draw configuration graphs
- added $GenerateConfigGraph configuration command which can be used
  to generate nice-looking (and very informative) rsyslog configuration
  graphs.
- added $ActionName configuration directive (currently only used for
  graph generation, but may find other uses)
2009-05-11 17:38:33 +02:00
Rainer Gerhards
9e1bb31a4d fixed some bugs & added testing helpers
The action state machine now works correctly and has been verified a
few hand-picked cases. I am missing automatted tests, though, this is
not easy to achive... Anyhow, I've improved omtesting, so that it can
be used in such automatted tests.
2009-05-07 13:37:25 +02:00