From 89216d6a96ea5f6d1fa9893d56fa877a2131d390 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 19 Mar 2010 09:42:46 +0100 Subject: 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. --- runtime/stream.c | 3 +++ tests/asynwr_deadlock4.sh | 4 ++-- tools/omfile.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/stream.c b/runtime/stream.c index e2f6623e..bfeecee5 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -641,6 +641,9 @@ static rsRetVal strmConstructFinalize(strm_t *pThis) } } + DBGPRINTF("file stream %s params: flush interval %d, async write %d\n", + (pThis->pszFName == NULL) ? "N/A" : (char*)pThis->pszFName, + pThis->iFlushInterval, pThis->bAsyncWrite); /* if we have a flush interval, we need to do async writes in any case */ if(pThis->iFlushInterval != 0) { pThis->bAsyncWrite = 1; diff --git a/tests/asynwr_deadlock4.sh b/tests/asynwr_deadlock4.sh index cf1beddb..a3452f5b 100755 --- a/tests/asynwr_deadlock4.sh +++ b/tests/asynwr_deadlock4.sh @@ -12,8 +12,8 @@ echo =========================================================================== echo TEST: \[asynwr_deadlock4.sh\]: a case known to have caused a deadlock in the past source $srcdir/diag.sh init # uncomment for debugging support: -export RSYSLOG_DEBUG="debug nostdout noprintmutexaction" -export RSYSLOG_DEBUGLOG="log" +#export RSYSLOG_DEBUG="debug nostdout noprintmutexaction" +#export RSYSLOG_DEBUGLOG="log" source $srcdir/diag.sh startup asynwr_deadlock4.conf # send 20000 messages, each close to 2K (non-randomized!), so that we can fill # the buffers and hopefully run into the "deadlock". diff --git a/tools/omfile.c b/tools/omfile.c index 438f8c4a..c4e834cc 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -413,7 +413,7 @@ prepareFile(instanceData *pData, uchar *newFileName) * async processing, which is a real performance waste if we do not do buffered * writes! -- rgerhards, 2009-07-06 */ - if(pData->bFlushOnTXEnd) + if(!pData->bFlushOnTXEnd) CHKiRet(strm.SetiFlushInterval(pData->pStrm, pData->iFlushInterval)); if(pData->pszSizeLimitCmd != NULL) CHKiRet(strm.SetpszSizeLimitCmd(pData->pStrm, ustrdup(pData->pszSizeLimitCmd))); -- cgit v1.2.3