summaryrefslogtreecommitdiffstats
path: root/runtime/wti.c
Commit message (Collapse)AuthorAgeFilesLines
* enhanced test environment (including testbench)Rainer Gerhards2009-10-221-1/+1
| | | | | | | | 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.
* new queue engine - initial commit (probably not 100% working!)Rainer Gerhards2009-10-141-31/+3
| | | | | | | | | | 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.
* added some debug settings plus improved shutdown sequenceRainer Gerhards2009-10-131-0/+15
| | | | ... non-working version!
* bugfix and testbench improvementsRainer Gerhards2009-10-071-3/+12
| | | | | | | | - 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
* bugfix: potential race condition when queue worker threads were terminatedRainer Gerhards2009-10-061-1/+10
|
* simplified startup of queue DA modeRainer Gerhards2009-07-201-2/+0
|
* solved potential race condition and some cleanupRainer Gerhards2009-07-201-0/+2
| | | | | | | 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.
* bugfix: minor static memory leak while reading configurationRainer Gerhards2009-07-201-5/+2
| | | | | This did NOT leak based on message volume. Also, did some cleanup during the commit.
* enhanced worker thread pool by atomic opsRainer Gerhards2009-07-201-5/+7
| | | | | ... greater performance and was able to remove a potential troublespot in a cancel cleanup handler.
* architecture change: queue now always has at least one worker threadRainer Gerhards2009-07-201-1/+13
| | | | | | ...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.
* removed mutex locksRainer Gerhards2009-07-171-1/+1
| | | | | ... by utilizing that we need to modify a state variable only in a sequential way during shutdown.
* further code simplificationRainer Gerhards2009-07-171-101/+24
| | | | | | | | | ... 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.
* more code simplification, should also bring some performance enhancementRainer Gerhards2009-07-171-12/+10
| | | | reducing the number of thread cancellation state changes
* some code simplificationRainer Gerhards2009-07-161-8/+6
|
* Merge branch 'detached' into masterRainer Gerhards2009-07-151-108/+11
|\ | | | | | | | | Conflicts: tests/nettester.c
| * further reduction in code size/complexity due to design changeRainer Gerhards2009-07-081-5/+0
| |
| * simplified worker thread handlingRainer Gerhards2009-07-081-103/+11
| | | | | | | | | | based on now working with detached threads. This is probably the biggest patch in this series and with large bug potential.
* | some more (very mild) cleanupRainer Gerhards2009-07-151-1/+0
|/
* optimizing queue thread handlingRainer Gerhards2009-07-081-2/+2
| | | | | | ... 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.
* improvements/fixes in queue termination timeout handlingRainer Gerhards2009-06-251-2/+6
| | | | | | | | - 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)
* Merge branch 'master' into v5-develRainer Gerhards2009-06-251-2/+5
|\ | | | | | | | | | | Conflicts: runtime/atomic.h runtime/wti.c
| * some memory accesses are now explicitely atomicRainer Gerhards2009-06-251-9/+17
| | | | | | | | | | ... as far as I think this mostly is to keep the thread debuggers happy
* | added a few atomic operationsRainer Gerhards2009-06-251-10/+14
| | | | | | | | | | mostly to get thread debugger errors clean (plus, of course, it makes things more deterministic)
* | bugfix: mutex was sometimes released when not being heldRainer Gerhards2009-06-241-4/+8
| |
* | Merge branch 'omfile' into tmpRainer Gerhards2009-06-221-13/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * removed pthread_testcancel() as it is no longer necessaryRainer Gerhards2009-06-191-22/+0
| | | | | | | | | | | | | | 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).
| * removed uniprocessor optimizationRainer Gerhards2009-06-191-5/+0
| | | | | | | | | | | | ... as it was not even optimal on uniprocessors any longer ;) I keep the config directive in, maybe we can utilize it again at some later point in time (questionable).
| * fixed a small memory leak...Rainer Gerhards2009-06-101-2/+1
| | | | | | | | and another problem, both introduced today. Also did some general cleanup.
* | some more fixes for queue engineRainer Gerhards2009-05-281-1/+1
| | | | | | | | The enhanced testbench now runs without failures, again
* | fixing an issue during DA mode queue shutdownRainer Gerhards2009-05-281-0/+1
| | | | | | | | | | also changed DA queue mode in that the regular workers now run concurrently.
* | preserving current changesRainer Gerhards2009-05-281-11/+2
| | | | | | | | | | | | ... in preparation for some larger changes - I need to apply some serious design changes, as the current system does not play well at all with ultra-reliable queues. Will do that in a totally new version.
* | interim commit: working on failure casesRainer Gerhards2009-05-271-7/+23
| | | | | | | | slightly improved situation, would like to save it before carrying on
* | solved design issue with queue terminationRainer Gerhards2009-05-261-3/+10
| | | | | | | | | | | | | | | | | | | | | | ... and also improved the test suite. There is a design issue in the v3 queue engine that manifested to some serious problems with the new processing mode. However, in v3 shutdown may take eternally if a queue runs in DA mode, is configured to preserve data AND the action fails and retries immediately. There is no cure available for v3, it would require doing much of the work we have done on the new engine. The window of exposure, as one might guess from the description, is very small. That is probably the reason why we have not seen it in practice.
* | free last processed message in all casesRainer Gerhards2009-05-201-28/+48
| | | | | | | | | | | | | | | | | | so far, the last processed message was only freed when the next one was processed. This has been changed now. More precisely, a better algorithm has been selected for the queue worker process, which also involves less overhead than the previous one. The fix for "free last processed message" as then more or less a side-effect (easy to do) of the new algorithm.
* | yield() no longer needed on uniproc thanks to new algorithmsRainer Gerhards2009-05-201-23/+4
| |
* | some cleanupRainer Gerhards2009-05-191-1/+0
| |
* | one astrisk too much - and we have a segfault... - fixed ;)Rainer Gerhards2009-05-121-1/+1
| |
* | moving to a cleaner implementation of batchesRainer Gerhards2009-05-121-6/+4
| | | | | | | | ... now that we know what we need from a theoretical POV.
* | fixed abort condition in DA modeRainer Gerhards2009-04-231-1/+0
| |
* | fixing a small (newly-introduced) memory leakRainer Gerhards2009-04-231-5/+3
| | | | | | | | | | ... plus simplifying free() calls after agreement on mailing list that we no longer need to check if the pointer is non-NULL
* | added $MainMsgQueueDequeueBatchSize and $ActionQueueDequeueBatchSize ↵Rainer Gerhards2009-04-231-3/+3
| | | | | | | | configuration directives
* | first attempt at dequeueing multiple batches inside the queueRainer Gerhards2009-04-221-3/+14
|/ | | | | | ... but this code has serious problems when terminating the queue, also it is far from being optimal. I will commit a series of patches (hopefully) as I am on the path to the final implementation.
* Merge branch 'dapatch'Rainer Gerhards2009-03-251-3/+7
|\
| * bugfix: potential abort with DA queue after high watermark is reachedRainer Gerhards2009-03-251-3/+7
| | | | | | | | | | | | There exists a race condition that can lead to a segfault. Thanks go to vbernetr, who performed the analysis and provided patch, which I only tweaked a very little bit.
* | integrated various patches for solarisRainer Gerhards2009-03-051-0/+5
| | | | | | | | | | | | | | | | | | Unfortunatley, I do not have the full list of contributors available. The patch set was compiled by Ben Taylor, and I made some further changes to adopt it to the news rsyslog branch. Others provided much of the base work, but I can not find the names of the original authors. If you happen to be one of them, please let me know so that I can give proper credits.
* | added a setting "$OptimizeForUniprocessor"Rainer Gerhards2008-10-221-1/+14
| | | | | | | | | | | | ...to enable users to turn off pthread_yield calls which are counter-productive on multiprocessor machines (but have been shown to be useful on uniprocessors)
* | reordered imudp processing.Rainer Gerhards2008-10-081-3/+3
| | | | | | | | | | | | Message parsing is now done as part of main message queue worker processing (was part of the input thread) This should also improve performance, as potentially more work is done in parallel.
* | improved threadingRainer Gerhards2008-09-301-5/+4
|/ | | | | | | | - changed sequence when awakening thread - removed no longer needed condition variable - EXPERIMENTALLY added mutex guarding to hostname lookups this is to be removed if it does not have any verifyable useful effect
* reduced number of compile warnings in -pedantic gcc modeRainer Gerhards2008-06-271-1/+1
|
* disabled compile warnings caused by third-party librariesRainer Gerhards2008-06-231-0/+2
|