summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-06-04 12:01:24 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-06-04 12:01:24 +0200
commit55659b96a38d926445c9ae4123df4b1d29e18c32 (patch)
treeeab6e616e3b82a1dd76b0b5cbef3052ee837525f
parent9020647cdcdb0ef132491838e36c870f4e4e90ea (diff)
downloadrsyslog-55659b96a38d926445c9ae4123df4b1d29e18c32.tar.gz
rsyslog-55659b96a38d926445c9ae4123df4b1d29e18c32.tar.xz
rsyslog-55659b96a38d926445c9ae4123df4b1d29e18c32.zip
add small delay (50ms) after sending shutdown message
There seem to be cases where the shutdown message is otherwise not processed, not even on an idle system. Thanks to Marcin for bringing this problem up.
-rw-r--r--ChangeLog4
-rw-r--r--tools/syslogd.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 25a67cfa..fd2b076a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,10 @@ Version 5.8.12 [V5-stable] 2012-05-??
please let us know.
Thanks to Tomas Heinrich for the patch.
- bugfix/tcpflood: sending small test files did not work correctly
+- add small delay (50ms) after sending shutdown message
+ There seem to be cases where the shutdown message is otherwise not
+ processed, not even on an idle system. Thanks to Marcin for
+ bringing this problem up.
---------------------------------------------------------------------------
Version 5.8.11 [V5-stable] 2012-05-03
- bugfix: ommysql did not properly init/exit the mysql runtime library
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 7872cb5f..0988d462 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1072,6 +1072,11 @@ die(int sig)
errno = 0;
logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)buf, 0);
}
+ /* we sleep for 50ms to give the queue a chance to pick up the exit message;
+ * otherwise we have seen cases where the message did not make it to log
+ * files, even on idle systems.
+ */
+ srSleep(0, 50);
/* drain queue (if configured so) and stop main queue worker thread pool */
DBGPRINTF("Terminating main queue...\n");