summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-25 14:16:31 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-25 14:16:31 +0200
commitb9549380270fa68e27e8ee3f049c7d34156a85ff (patch)
treee19337d9e942ee0bc62fb08a60e0470b4868a344
parent7a7ec37f99f3dd5120952e6ca6263dd72061abb1 (diff)
downloadrsyslog-b9549380270fa68e27e8ee3f049c7d34156a85ff.tar.gz
rsyslog-b9549380270fa68e27e8ee3f049c7d34156a85ff.tar.xz
rsyslog-b9549380270fa68e27e8ee3f049c7d34156a85ff.zip
solved some issues with testbench & a race condition
-rw-r--r--runtime/modules.c10
-rwxr-xr-xtests/imtcp-multiport.sh6
-rw-r--r--tests/testsuites/imtcp-multiport.conf3
3 files changed, 15 insertions, 4 deletions
diff --git a/runtime/modules.c b/runtime/modules.c
index 3e8662a3..32ae659f 100644
--- a/runtime/modules.c
+++ b/runtime/modules.c
@@ -806,7 +806,15 @@ BEGINObjClassExit(module, OBJ_IS_LOADABLE_MODULE) /* CHANGE class also in END MA
CODESTARTObjClassExit(module)
/* release objects we no longer need */
objRelease(errmsg, CORE_COMPONENT);
- pthread_mutex_destroy(&mutLoadUnload);
+ /* We have a problem in our reference counting, which leads to this function
+ * being called too early. This usually is no problem, but if we destroy
+ * the mutex object, we get into trouble. So rather than finding the root cause,
+ * we do not release the mutex right now and have a very, very slight leak.
+ * We know that otherwise no bad effects happen, so this acceptable for the
+ * time being. -- rgerhards, 2009-05-25
+ *
+ * TODO: add again: pthread_mutex_destroy(&mutLoadUnload);
+ */
# ifdef DEBUG
modUsrPrintAll(); /* debug aid - TODO: integrate with debug.c, at least the settings! */
diff --git a/tests/imtcp-multiport.sh b/tests/imtcp-multiport.sh
index aa1f15e8..17480dae 100755
--- a/tests/imtcp-multiport.sh
+++ b/tests/imtcp-multiport.sh
@@ -17,7 +17,7 @@ if [ "$?" -ne "0" ]; then
echo "error during tcpflood! see rsyslog.out.log.save for what was written"
cp rsyslog.out.log rsyslog.out.log.save
fi
-sleep 2 # we need this so that rsyslogd can receive all outstanding messages
+$srcdir/waitqueueempty.sh # wait until rsyslogd is done processing messages
kill `cat rsyslog.pid`
rm -f work
sort < rsyslog.out.log > work
@@ -42,7 +42,7 @@ if [ "$?" -ne "0" ]; then
echo "error during tcpflood! see rsyslog.out.log.save for what was written"
cp rsyslog.out.log rsyslog.out.log.save
fi
-sleep 2 # we need this so that rsyslogd can receive all outstanding messages
+$srcdir/waitqueueempty.sh # wait until rsyslogd is done processing messages
kill `cat rsyslog.pid`
rm -f work
sort < rsyslog.out.log > work
@@ -67,7 +67,7 @@ if [ "$?" -ne "0" ]; then
echo "error during tcpflood! see rsyslog.out.log.save for what was written"
cp rsyslog.out.log rsyslog.out.log.save
fi
-sleep 2 # we need this so that rsyslogd can receive all outstanding messages
+$srcdir/waitqueueempty.sh # wait until rsyslogd is done processing messages
kill `cat rsyslog.pid`
rm -f work
sort < rsyslog.out.log > work
diff --git a/tests/testsuites/imtcp-multiport.conf b/tests/testsuites/imtcp-multiport.conf
index 00b63cb2..ec059fe4 100644
--- a/tests/testsuites/imtcp-multiport.conf
+++ b/tests/testsuites/imtcp-multiport.conf
@@ -6,6 +6,9 @@ $InputTCPServerRun 13514
$InputTCPServerRun 13515
$InputTCPServerRun 13516
+$ModLoad ../plugins/imdiag/.libs/imdiag
+$IMDiagServerRun 13500
+
$ErrorMessagesToStderr off
$template outfmt,"%msg:F,58:2%\n"