diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-26 12:43:43 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-26 12:43:43 +0200 |
commit | aa9426f683fa6af9280bc63050ee0187ba4c57e1 (patch) | |
tree | 5ba68517cc2661ab3de4afb417592ed67bdab183 /tests/memq-persist.sh | |
parent | 210f43137d6a077abbd8b77c1f72193dcd81cc99 (diff) | |
download | rsyslog-aa9426f683fa6af9280bc63050ee0187ba4c57e1.tar.gz rsyslog-aa9426f683fa6af9280bc63050ee0187ba4c57e1.tar.xz rsyslog-aa9426f683fa6af9280bc63050ee0187ba4c57e1.zip |
solved design issue with queue termination
... 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.
Diffstat (limited to 'tests/memq-persist.sh')
-rwxr-xr-x | tests/memq-persist.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/memq-persist.sh b/tests/memq-persist.sh index 108cba57..e935d8db 100755 --- a/tests/memq-persist.sh +++ b/tests/memq-persist.sh @@ -10,9 +10,11 @@ #export RSYSLOG_DEBUGLOG="log" echo testing memory queue persisting to disk $srcdir/killrsyslog.sh # kill rsyslogd if it runs for some reason +rm -f core.* rm -rf test-spool mkdir test-spool rm -f work rsyslog.out.log rsyslog.out.log.save # work files +#valgrind ../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/memq-persist1.conf & ../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/memq-persist1.conf & sleep 1 echo "rsyslogd started with pid " `cat rsyslog.pid` @@ -22,20 +24,22 @@ 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 3 # we need to wait to ensure everything is received (less 1 second would be better) +sleep 4 # we need to wait to ensure everything is received (less 1 second would be better) kill `cat rsyslog.pid` -sleep 5 # wait for engine to terminate +echo wait for shutdown +$srcdir/waitqueueempty.sh # wait until rsyslogd is done processing messages echo There must exist some files now: ls -l test-spool # restart engine and have rest processed ../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/memq-persist2.conf & +sleep 1 $srcdir/waitqueueempty.sh # wait until rsyslogd is done processing messages kill `cat rsyslog.pid` rm -f work sort < rsyslog.out.log > work -./chkseq work 0 9999 +./chkseq -fwork -e9999 -d if [ "$?" -ne "0" ]; then - # rm -f work rsyslog.out.log + rm -f work rsyslog.out.log echo "sequence error detected" exit 1 fi |