77 Commits

Author SHA1 Message Date
Rainer Gerhards
de71589ca3 Merge branch 'v6-stable'
Conflicts:
	ChangeLog
	configure.ac
	runtime/ruleset.c
	tools/syslogd.c
2012-08-25 12:19:56 +02:00
Rainer Gerhards
9faf2240c4 changed TRUE/FALSE to RSTRUE/RSFALSE
This is done to prevent name claches with libraries.
2012-08-22 15:29:02 +02:00
Rainer Gerhards
04399f5ebe added --enable-debugless configure option for very high demanding environments
This actually at compile time disables a lot of debug code, resulting
in some speedup (but serious loss of debugging capabilities)
2012-05-29 12:01:07 +02:00
Rainer Gerhards
32df7bf254 Merge branch 'v6-stable'
Conflicts:
	runtime/queue.c
2012-03-12 17:11:59 +01:00
Rainer Gerhards
f90675f33f Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	ChangeLog
	action.c
	configure.ac
	doc/imuxsock.html
	doc/manual.html
	runtime/queue.c
2012-03-12 17:00:21 +01:00
Rainer Gerhards
16cc84fc69 bugfix: stopped DA queue was never processed after a restart
...due to a regression from statistics module.
2012-03-12 15:04:08 +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
abb381b8a5 Merge branch 'v5-stable-newstats' into v5-devel
Conflicts:
	plugins/imtcp/imtcp.c
2012-01-16 17:04:10 +01:00
Rainer Gerhards
18e60f46a1 Merge branch 'v4-stable' into v5-stable
Conflicts:
	runtime/debug.h
	runtime/obj.c
	runtime/parser.h
	runtime/wti.h
2012-01-16 16:14:30 +01:00
Rainer Gerhards
bd22bf8cb4 license changes 2012-01-16 15:23:01 +01:00
Rainer Gerhards
1bfaf4ac06 better handling of queue i/o errors in disk queues.
This is kind of a bugfix, but a very intrusive one, thus it goes
into the devel version first. Right now, "file not found" is
handled and leads to the new emergency mode, in which disk action
is stopped and the queue run in direct mode. An error message is
emited if this happens.
2011-05-03 12:27:49 +02:00
Rainer Gerhards
802f6d8a8f milestone(BUGGY): batch now pushed down to action
at least in important cases (not for non-direct action queues and some
other minor things). This version is definitely buggy, but may be tried
with success on a non-production system. I will continue to work on the
correctness, but needed to commit now to get a baseline.
2010-06-15 14:02:34 +02:00
Rainer Gerhards
7574e70df4 fixed race conditions during queue shutdown (DA case, disks active) 2010-05-18 17:53:12 +02:00
Rainer Gerhards
af8582e509 added new cancel-reduced action thread termination method
We now manage to cancel threads that block inside a retry loop to
terminate without the need to cancel the thread. Avoiding cancellation
helps keep the system complexity minimal and thus provides for better
stability. This also solves some issues with improper shutdown when
inside an action retry loop.
2010-05-17 14:24:27 +02:00
Rainer Gerhards
2da019bfca small cleanup 2010-05-10 15:12:46 +02:00
Rainer Gerhards
dd76d96d67 adapted new atomic instruction emulation to v5 engine
code did not compile after merge from v4
2010-04-27 18:26:09 +02:00
Rainer Gerhards
4a5a3196fb Merge branch 'v4-devel' into master
Conflicts:
	runtime/Makefile.am
	runtime/atomic.h
	runtime/queue.c
	runtime/queue.h
	runtime/wti.c
	runtime/wti.h
	runtime/wtp.c
	runtime/wtp.h
2010-04-27 17:49:06 +02:00
Rainer Gerhards
cbe2e3d444 bugfix: problems with atomic operations emulation
replaced atomic operation emulation with new code. The previous code
seemed to have some issue and also limited concurrency severely. The
whole atomic operation emulation has been rewritten.
2010-04-27 17:31:28 +02:00
Rainer Gerhards
38cb392672 replaced data type "bool" by "sbool" because this created some portability issues 2010-02-02 15:51:01 +01:00
Rainer Gerhards
553d1880d4 some cleanup 2009-10-27 10:36:53 +01:00
Rainer Gerhards
24cd5aee47 fixed race condition during queue shutdown
Problems could happen if the queue worker needed to be cancelled
and this cancellation happened inside queue-code (including
wtp, wti). We have now solved this by disabling cancellation while
in this code and only enabling it when working inside the user consumer.
This exactly matches the use case for which cancellation may be needed.
2009-10-27 10:00:23 +01:00
Rainer Gerhards
b585a4e909 addressed some race issues during queue shutdown
these occured in very unusual scenarios where we had a DA-queue running
in parallel and very lengthy actions. Then, in some situations, the
shutdown could hang. The code needs some addition lab time, but
is believed to be much better than any previous version.
2009-10-26 18:53:01 +01:00
Rainer Gerhards
e04e1b5002 enhanced test environment (including testbench)
support for enhancing probability of memory addressing failure by
using non-NULL default value for malloced memory (optional, only if
requested by configure option). This helps to track down some
otherwise undetected issues within the testbench and is expected
to be very useful in the future.
2009-10-22 11:33:38 +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
5625dbd1b6 bugfix and testbench improvements
- bugfix: solved potential (temporary) stall of messages when the queue was
  almost empty and few new data added (caused testbench to sometimes hang!)
- fixed some race condition in testbench
- added more elaborate diagnostics to parts of the testbench
- solved a potential race inside the queue engine
2009-10-07 18:40:30 +02:00
Rainer Gerhards
caeb203f51 bugfix: potential race condition when queue worker threads were terminated 2009-10-06 16:22:32 +02:00
Rainer Gerhards
ff6963d6f6 simplified startup of queue DA mode 2009-07-20 15:06:32 +02:00
Rainer Gerhards
1c58074339 solved potential race condition and some cleanup
code review brought up some few places where we may have run into a race.
They have most probably been introduced during the recent set of changes. But
I do not look at older versions because of the changed architecture, one can
not simply backport this patch.
2009-07-20 12:53:00 +02:00
Rainer Gerhards
bf8125f4e9 bugfix: minor static memory leak while reading configuration
This did NOT leak based on message volume. Also, did some cleanup during
the commit.
2009-07-20 12:18:20 +02:00
Rainer Gerhards
4ec7b9d9ec enhanced worker thread pool by atomic ops
... greater performance and was able to remove a potential troublespot
in a cancel cleanup handler.
2009-07-20 11:52:05 +02:00
Rainer Gerhards
ef70e6174d architecture change: queue now always has at least one worker thread
...if not running in direct mode. Previous versions could run without
any active workers. This simplifies the code at a very small expense.
See v5 compatibility note document for more in-depth discussion.
2009-07-20 10:25:02 +02:00
Rainer Gerhards
ac186f1c3d removed mutex locks
... by utilizing that we need to modify a state variable only in
a sequential way during shutdown.
2009-07-17 19:59:22 +02:00
Rainer Gerhards
4c9eded44d further code simplification
... could even remove one mutex by using a better algorithm. I think I also
spotted some situation in which a hang could have happened. As I can't fix it
in v4 and less without moving to the new engine, I make no effort in testing
this out. Hangs occur during shutdown, only (if at all). The code changes
should also result in some mild performance improvement. Some bug potential,
but overall the bug potential should have been greatly reduced.
2009-07-17 18:40:28 +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
1d0806b9e3 calls to prctl() need to be based on configure results (cross-platform issue)
This is for another prctl() call, not present in the beta version (looks like it
would make sense to stick these into a utility function)
2009-07-16 13:51:52 +02:00
Rainer Gerhards
cb7f903730 some code simplification 2009-07-16 12:42:45 +02:00
Rainer Gerhards
65a449ded4 Merge branch 'detached' into master
Conflicts:
	tests/nettester.c
2009-07-15 14:30:18 +02:00
Rainer Gerhards
05cd77cd4d some more (very mild) cleanup 2009-07-15 14:28:33 +02:00
Rainer Gerhards
4b6e93d382 further reduction in code size/complexity due to design change 2009-07-08 18:45:23 +02:00
Rainer Gerhards
4cfbc7254a simplified worker thread handling
based on now working with detached threads. This is probably the biggest
patch in this series and with large bug potential.
2009-07-08 18:12:05 +02:00
Rainer Gerhards
9f286c0c4c optimizing queue thread handling
... first commit in a series of more. Makes worker threads detached. Needs more
testing (will be done soon) and if it works as expected, we can further reduce
code.
2009-07-08 16:58:53 +02:00
Rainer Gerhards
5af5b1e428 improvements/fixes in queue termination timeout handling
- bugfix: subtle (and usually irrelevant) issue in timout processing
  timeout could be one second too early if nanoseconds wrapped
- set a more sensible timeout for shutdow, now 1.5 seconds to complete
  processing (this also removes those cases where the shutdown message
  was not written because the termination happened before it)
2009-06-25 12:59:13 +02:00
Rainer Gerhards
d116f30a87 improvements/fixes in queue termination timeout handling
- bugfix: subtle (and usually irrelevant) issue in timout processing
  timeout could be one second too early if nanoseconds wrapped
- set a more sensible timeout for shutdow, now 1.5 seconds to complete
  processing (this also removes those cases where the shutdown message
  was not written because the termination happened before it)
2009-06-25 12:53:00 +02:00
Rainer Gerhards
e56a30372e Merge branch 'master' into v5-devel
Conflicts:
	runtime/atomic.h
	runtime/wti.c
2009-06-25 12:05:25 +02:00
Rainer Gerhards
d12b9e0c67 some memory accesses are now explicitely atomic
... as far as I think this mostly is to keep the thread debuggers
happy
2009-06-25 12:03:14 +02:00
Rainer Gerhards
4602483444 added a few atomic operations
mostly to get thread debugger errors clean (plus, of course, it
makes things more deterministic)
2009-06-25 11:06:42 +02:00
Rainer Gerhards
c60cbd99df bugfix: mutex was sometimes released when not being held 2009-06-24 17:00:10 +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
7b3dad877e removed pthread_testcancel() as it is no longer necessary
we usually stay long enough inside the actions, so there should be
no problem with reaching a cancellation point. Actually, if we
really need to cancel, the thread is in an output action (otherwise
it would have willingly terminated).
2009-06-19 12:10:38 +02:00