91 Commits

Author SHA1 Message Date
Rainer Gerhards
559cb84a79 fixing msg duplication & loss regression, causes slowdown
messages could get lost or be duplicated due to non-proper sync
of transactions. This is a notable slowdown again, but we know
how to get back concurrency, it just takes "some" more programming.
It is important now to come back to correct code, so that we can
base further improvements on that.
2010-06-10 10:17:04 +02:00
Rainer Gerhards
220c57e7eb bugfix: regression caused more locking action in msg.c than necessary
also: bugfix: mutexes used to similate atomic instructions were not destructed
2010-06-08 08:25:56 +02:00
Rainer Gerhards
4e511087c4 some cleanup 2010-04-19 15:21:25 +02:00
Rainer Gerhards
ada87cbaef Merge branch 'v4-devel' into master
Conflicts:
	ChangeLog
	Makefile.am
	configure.ac
	doc/manual.html
	runtime/debug.c
	runtime/rsyslog.h
	tests/Makefile.am
	tests/diag.sh
	tests/nettester.c
	tools/syslogd.c
2010-04-19 15:13:33 +02:00
Rainer Gerhards
25bc3b2e30 Merge branch 'v4-stable-solaris' into v4-devel
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	tools/omfile.c
	tools/syslogd.c
2010-04-12 09:10:19 +02:00
Rainer Gerhards
8f0a8076cc Merge branch 'beta' into master
Conflicts:
	ChangeLog
	configure.ac
	plugins/imudp/imudp.c
	runtime/stream.h
	tests/Makefile.am
	tests/diag.sh
	tools/omfile.c
2010-04-09 13:00:56 +02:00
Rainer Gerhards
87a957b0f5 Merge branch 'v4-stable-solaris' into beta
Conflicts:
	runtime/Makefile.am
	runtime/rsyslog.c
	tests/nettester.c
	tools/syslogd.c
2010-04-09 12:27:59 +02:00
Rainer Gerhards
e2ceb7247c bugfix: default for $OMFileFlushOnTXEnd was wrong ("off").
This, in default mode, caused buffered writing to be used, what
means that it looked like no output were written or partial
lines. Thanks to Michael Biebl for pointing out this bug.
2010-04-07 14:25:40 +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
77f4230c10 $OMFileAsyncWriting directive did not work properly 2010-03-25 17:36:50 +01:00
Rainer Gerhards
d102aab886 new feature: $OMFileAsyncWriting directive added
it permits to specifiy if asynchronous writing should be done or not
2010-03-25 15:23:39 +01:00
Rainer Gerhards
bcddd30c2e undo experimental commit dccadb677c5a6b8379f631e4c1f14c8c4089d4a6
Further testing turned out that the rsyslog core works correctly and
this fix is not needed. The concurrency we saw was actually caused by
other actions (even processes) during directory creation. See commit
9e5b31fc44136dbcc1e443cfe7714e9daf97d844 for further details.
2010-03-25 08:13:58 +01:00
Rainer Gerhards
28b3703c95 bugfix: potential segfault in dynafile cache
This bug was triggered by an open failure. The the cache was full and
a new entry needed to be placed inside it, a victim for eviction was
selected. That victim was freed, then the open of the new file tried. If
the open failed, the victim entry was still freed, and the function
exited. However, on next invocation and cache search, the victim entry
was used as if it were populated, most probably resulting in a segfault.
2010-03-25 07:56:03 +01:00
Rainer Gerhards
5d58774813 streamline dynafile cache entry deletion a bit
The old code looks a bit "strange", though not necessarily incorrect.
The new code looks correct and is probably less irritating during bug
hunting.
2010-03-23 14:21:33 +01: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
a28a31feea previous (experimental) patch was somewhat incorrect, fixed
This is what caused the new test to fail...
2010-03-22 14:22:22 +01:00
Rainer Gerhards
dccadb677c exp: made omfile ensure that it is not called twice in parallel on the same file instance
In theory, the rsyslog core should never call in parallel into an output
module for the same instance. However, it looks like this seems to happen
under (strange?) circumstances. I have now enhanced omfile so that it guards
itself against being called in parallel on the same instance data. This is
done to help troubleshooting and may stay as an interim solution if it
proves to solve an anomaly we see in at least one installation (to trigger
this problem, an extremely large traffic volume is needed).
2010-03-21 18:52:51 +01:00
Rainer Gerhards
89216d6a96 fixed regression from previos (yet unrelease) $omfileFlushOnTXEnd fix
The previous fix fixed an issue with on/off bying used in the exact wrong
semantic. It corrected the situation, but failed to fix one spot where the
wrong semantics were used. This is done with this commit.

Note that this is NOT a bug seen in any released version.
2010-03-19 09:42:46 +01:00
Rainer Gerhards
ba0f23182a new feature: "." action type added to support writing files to relative pathes
(this is primarily meant as a debug aid)
2010-03-17 16:25:24 +01:00
Rainer Gerhards
3d80d6ba30 bugfix: potential problem (loop, abort) when file write error occured
When a write error occured in stream.c, variable iWritten had the error
code but this was handled as if it were the actual number of bytes
written. That was used in pointer arithmetic later on, and thus could
lead to all sorts of problems. However, this could only happen if the
error was EINTR or the file in question was a tty. All other cases were
handled properly. Now, iWritten is reset to zero in such cases, resulting
in proper retries.
2010-03-09 18:07:31 +01:00
Rainer Gerhards
7916735ba6 retain old $OMFileFlushOnTXEnd semantics
required because due to bug the default was actually different than
specified (or better said: spec was inconsistent in doc as well).
2010-03-09 17:57:46 +01:00
Rainer Gerhards
9e0426da5f bugfix: $omfileFlushOnTXEnd was turned on when set to off and vice versa 2010-03-09 17:52:01 +01:00
Rainer Gerhards
06387e5592 Merge branch 'v4-stable' into beta
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	tests/rt-init.c
2010-03-08 14:27:20 +01:00
Rainer Gerhards
34d1694e9d bugfix: omfile.c did not properly compile without atomics
while this worked on another platform, it did not work here, and failed
to do so for good reasons ;)
2010-03-05 12:53:15 +01:00
Rainer Gerhards
40be6cb6e7 Merge branch 'v4-stable-solaris' into master-solaris
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	tests/rt-init.c
2010-03-05 09:54:42 +01:00
Rainer Gerhards
129eeca64b relaxed need for atomic builtins 2010-03-05 09:36:45 +01:00
Rainer Gerhards
6cf9bf703d bugfix: potential (but very impropable) segfaults in omfile
- bugfix: potential segfault in omfile when a dynafile open failed
  In that case, a partial cache entry was written, and some internal
  pointers (iCurrElt) not correctly updated. In the next iteration, that
  could lead to a segfault, especially if iCurrElt then points to the
  then-partial record. Not very likely, but could happen in practice.
- bugfix (theoretical): potential segfault in omfile under low memory
  condition. This is only a theoretical bug, because it would only
  happen when strdup() fails to allocate memory - which is highly
  unlikely and will probably lead to all other sorts of errors.
2010-03-02 11:32:43 +01:00
Rainer Gerhards
abef390dae Merge branch 'beta' into master
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
	tools/syslogd.c
2010-03-01 14:21:49 +01:00
Rainer Gerhards
eb3afa8000 Merge branch 'v4-stable' into tmp 2010-03-01 12:52:25 +01:00
Rainer Gerhards
2c39f76037 make $ActonFileDefaultTemplate available to ompipe
This was not honored by the new ompipe module, because it is a local
file directive (it was applied to pipes as a side-effect of using the
same module for pipes and files...). I now made this a global, so that
semantics are the same as previously. Not really nice, but probably
the best thing to do in the current situation (everything else would
involve much more overhead --- leave that for the new config system).
2010-03-01 07:33:09 +01:00
Rainer Gerhards
791d8ea863 some code cleanup 2010-02-28 17:28:52 +01:00
Rainer Gerhards
50636ba267 moved pipe code to its own module
... based on old omfile. Michael Biebl reported that xconsole seems
to have some issues with the new pipe code, so it was best to use
the old code for pipes. The optimizations were done to speed up file
access, so it doesn't really matter pipes do not receive them.
2010-02-28 17:18:04 +01: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
62e00d7a1c Merge branch 'v4-beta' into tmp
Conflicts:
	ChangeLog
2010-01-26 12:03:50 +01:00
Rainer Gerhards
9901996b5b Merge branch 'v4-beta' into beta
Conflicts:
	ChangeLog
2010-01-15 17:03:51 +01:00
Rainer Gerhards
5b4e06fc28 bugfix: rsyslog hangs when writing to a named pipe which nobody was reading.
Thanks to Michael Biebl for reporting this bug.
2010-01-15 17:01:10 +01:00
Rainer Gerhards
abdc2870f1 worked around an issue where omfile failed to compile on 32 bit platforms
...under some circumstances (this smells like a gcc problem, but a simple
solution was available). Thanks to Kenneth Marshall for some advice.
[backported from 5.5.x branch]
2009-12-09 16:49:07 +01:00
Rainer Gerhards
d695383cd6 Merge branch 'v5-stable' into beta 2009-11-30 12:02:27 +01:00
Rainer Gerhards
5a0bd837e9 Merge branch 'v4-stable' into v5-stable
Conflicts:
	doc/rsyslog_conf_modules.html
2009-11-30 12:01:53 +01:00
Rainer Gerhards
c3f07d9dda Merge branch 'v4-beta' into v4-devel 2009-11-30 11:57:49 +01:00
Rainer Gerhards
4cc7a7c16c Merge branch 'v4-stable' into v4-beta 2009-11-30 11:51:32 +01:00
Rainer Gerhards
cf1275d846 Merge branch 'v3-stable' into v4-stable 2009-11-30 11:51:20 +01:00
Rainer Gerhards
7b40604e9a bugfix: $CreateDirs variable not properly initialized
default thus was random (but most often "on")
2009-11-30 11:50:57 +01:00
Rainer Gerhards
35fa257f37 bugfix: omfile output was only written when buffer was full
... not at end of transaction.
2009-11-18 14:27:04 +01:00
Rainer Gerhards
b24ea47ea2 some improvement of omfile performance with dynafiles
saved costly time() calls by employing a logical clock, which is
sufficient for the use case
2009-11-10 14:36:23 +01:00
Rainer Gerhards
4578dc6a2d Merge branch 'v4-devel' into tmp 2009-11-05 14:34:21 +01:00
Rainer Gerhards
cd5f653ad8 Merge branch 'v4-beta' into v4-devel
Conflicts:
	tests/Makefile.am
2009-11-05 14:34:08 +01:00
Rainer Gerhards
a5cd509be7 bugfix: named pipes did no longer work (they always got an open error)
this was a regression from the omfile rewrite in 4.5.0
2009-11-05 12:44:57 +01:00
Rainer Gerhards
becc47cef6 enhanced omfile to support transactional interface
This will increase performance in many cases.
2009-10-13 10:16:18 +02:00
Rainer Gerhards
ed2cd2806e Merge branch 'v4-beta' into v4-devel
Conflicts:
	tools/omfile.c
2009-10-08 16:42:44 +02:00