43 Commits

Author SHA1 Message Date
Rainer Gerhards
bb7db923ad
iminternal bugfix: race on termination 2019-08-03 14:33:54 +02:00
Rich Megginson
8b92ea1bd9 mmkubernetes - support for metadata cache expiration
New parameters for mmkubernetes (module and action):

* `cacheexpireinterval`
If `cacheexpireinterval` is -1, then do not check for cache expiration.
If `cacheexpireinterval` is 0, then check for cache expiration.
If `cacheexpireinterval` is greater than 0, check for cache expiration
if the last time we checked was more than this many seconds ago.

* `cacheentryttl` - maximum age in seconds for cache entries

New statistics counters:

* `podcachenumentries` - the number of entries in the pod metadata cache.
* `namespacecachenumentries` - the number of entries in the namespace
  metadata cache.
* `podcachehits` - the number of times a requested entry was found in the
  pod metadata cache.
* `namespacecachehits` - the number of times a requested entry was found
  in the namespace metadata cache.
* `podcachemisses` - the number of times a requested entry was not found
  in the pod metadata cache, and had to be requested from Kubernetes.
* `namespacecachemisses` - the number of times a requested entry was not
  found in the namespace metadata cache, and had to be requested from
  Kubernetes.
2019-04-01 11:53:29 -06:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Janmejay Singh
93bfc583df Create support for unsigned 32-bit atomic arithmetic and migrate existing dynstats usage to it 2018-04-03 00:35:12 +05:30
Rainer Gerhards
dd9b98986d core bugfix: inconsitent atomic fetch function interface
macro used unsigned, inline function int. This could lead to an unsigned
overflow if macro version was used. That could potentially lead to malfunction
on some platforms (not seen nor expected in practice, though).

Detected by clang UBSAN.
2017-12-15 09:28:05 +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
6d89c9cdbe imdiag: fix cosmetic race in termination processing
This is not a real problem because imdiag intentionally does multiple
tries to validate predicate validity. However, this is reported in
clang thread sanitizer and so we need to fix it.
2017-11-05 15:57:38 +01:00
Janmejay Singh
d94abbf49f created a control to bump stats counter for batch-operations in one shot + some asthetic space->tab conversion 2015-11-17 16:16:24 +05:30
Rainer Gerhards
09ce215f66 fix build problem on platforms without atomic instructions
Thanks to Michael Biebl for his very helpful analysis of the bug.
2014-08-19 16:04:52 +02:00
Rainer Gerhards
6d668c915f cosmetic: fix some gcc --pedantic messages 2014-07-13 12:43:07 +02:00
Rainer Gerhards
6757ec6dd4 make rsyslogd -v output work in regard to 64 bit atomic buildin info 2014-06-04 15:25:29 +02: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
f6dea36394 runtime license change 2012-01-16 12:39:01 +01:00
Rainer Gerhards
1bfb97e576 bugfix: one type of 64bit atomics was enabled when 32bit atomics were supported
also cleaned up some minor things
2010-12-02 07:28:04 +01:00
Rainer Gerhards
f8769ca19d bugfix: fixed build problems on some platforms
namely those that have 32bit atomic operations but not 64 bit ones
2010-12-01 18:13:40 +01:00
Rainer Gerhards
a3c81f500a bugfix: replacements for atomic operations for non-int sized types had problems.
At least one instance of that problem could potentially lead
to abort (inside omfile).
2010-11-25 17:20:55 +01:00
Rainer Gerhards
0d721450eb added missing support for systems without atomic instructions 2010-06-24 14:01:05 +02:00
Rainer Gerhards
11bd517465 added support for high-performance action queue submission if not all mark messages should be logged
this was previously not properly handeld. This is also the first occurence of
a (real) CAS loop inside rsyslog. Note that the performance is now very well
in the default configuration, and mark message directives are still correctly
being handled. So this code looks close to final, but needs to have some
bug cleanup as the testsuite shows.
2010-06-08 15:20:33 +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
c26f830825 fixed recent regression: did not compile on systems with atomic instructions 2010-04-29 11:56:33 +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
24ad305375 Merge branch 'v4-devel' into master
Conflicts:
	ChangeLog
	configure.ac
	doc/manual.html
2010-04-23 13:02:41 +01:00
Rainer Gerhards
57eb123abe minor fix: invalid duplicated include of config.h 2010-04-23 12:59:11 +01:00
Rainer Gerhards
072fc663a8 added replacements for atomic instructions on systems that do not support them.
[backport of Stefen Sledz' patch for v5]
2010-03-23 15:04:24 +01:00
Rainer Gerhards
c1e3a032b4 Merge branch 'master-solaris' 2010-03-23 12:38:44 +01:00
Steffen Sledz
a61e164a97 emulate missing atomic builtins with posix semaphores if available
Signed-off-by: Steffen Sledz <sledz@dresearch.de>
Acked-by: Thilo Fromm <t.fromm@dresearch.de>
2010-03-23 11:11:30 +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
396e211e5c enabled compilation by using "racy" replacements for atomic instructions
... but this is not considered a real solution. For some of the
uses, it may acutally be sufficient, but the implications need
to be analyzed in detail.
2010-03-05 08:27:26 +01: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
12dc91a157 backported "clean" increment of memory trim counter (not protected by mutex) 2009-06-25 17:09:51 +02:00
Rainer Gerhards
4818b0081d bugfix: subtle synchronization issue
This may have caused a segfault under strange circumstances (but if
we just run long enough with a high enough message volume, even the
strangest circumstances will occur...)
2009-06-25 15:21:29 +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
0d69059091 Merge branch 'beta' 2009-01-30 15:41:29 +01:00
Rainer Gerhards
25245cc682 added info if atomic ops are available to rsyslogd -v output 2009-01-30 15:40:53 +01:00
Rainer Gerhards
2cfaf5f86a bugfix: inconsistent use of mutex/atomic operations could cause segfault
details are too many, for full analysis see blog post at:
http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html
2009-01-30 13:49:41 +01:00
Rainer Gerhards
14d5cc7f55 fixed atomic operations 2009-01-29 11:58:26 +01:00
Rainer Gerhards
bc70a73019 bugfix: proper synchronization on message destruction
The code was potentially race, at least on systems where
a memory barrier was needed. Fix not fully tested yet.
2008-09-19 17:41:11 +02:00
Rainer Gerhards
4c96ebdcfe bugfix: potential race condition when adding messages to queue
There was a wrong order of mutex lock operations. It is hard to
believe that really caused problems, but in theory it could and with
threading we often see that theory becomes practice if something is only
used long enough on a fast enough machine with enough CPUs ;)
2008-09-18 12:19:33 +02:00
Rainer Gerhards
988989e49e re-enabled gcc builtin atomic operations and added a proper ./configure check 2008-09-18 10:49:16 +02:00
Rainer Gerhards
8f8f65abb6 moved files to the runtime
there are still some files left which could go into the
runtime, but I think we will delete most of them once we
are done with the full modularization.
2008-04-16 10:26:54 +02:00
Rainer Gerhards
6c6e9a0f3f moved bParseHostname and bIsParsed to msgFlags
This enables us to use more efficient calling conventions and
also helps us keep the on-disk structure of a msg object more
consistent in future releases.
2008-10-09 13:45:56 +02:00