From b9ba5013ad39dbf60a0a3bc06c38870a803451fd Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 16 Dec 2010 14:23:38 +0100 Subject: bugfix: batch processing flagged invalid message as "bad" under some circumstances also fixed some cosmetic nits --- ChangeLog | 6 +++--- action.c | 4 ++-- runtime/cfsysline.c | 3 --- runtime/debug.c | 8 +++----- runtime/queue.c | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 533557a7..cfbee998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ --------------------------------------------------------------------------- -<<<<<<< HEAD Version 5.6.3 [V5-STABLE] (rgerhards), 2010-12-?? +- bugfix: batch processing flagged invalid message as "bad" under some + circumstances - bugfix: unitialized variable could cause issues under extreme conditions plus some minor nits. This was found after a clang static code analyzer analysis (great tool, and special thanks to Marcin for telling me about @@ -585,9 +586,8 @@ Version 4.6.5 [v4-stable] (rgerhards), 2010-??-?? in a tight loop, effectively disabling functionality and bearing the risk of unresponsiveness of the whole system. Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=194 -======= +--------------------------------------------------------------------------- Version 4.6.6 [v4-stable] (rgerhards), 2010-11-?? ->>>>>>> 371a8eec29fa25bbf58f4b1f0d7e3bf4c3ad6329 - bugfix: a couple of problems that imfile had on some platforms, namely Ubuntu (not their fault, but occured there) - bugfix: imfile utilizes 32 bit to track offset. Most importantly, diff --git a/action.c b/action.c index 0d298673..9591c393 100644 --- a/action.c +++ b/action.c @@ -971,7 +971,7 @@ submitBatch(action_t *pAction, batch_t *pBatch, int nElem) ; /* do nothing, this will retry the full batch */ } else if(localRet == RS_RET_ACTION_FAILED) { /* in this case, everything not yet committed is BAD */ - for(i = pBatch->iDoneUpTo ; i < nElem ; ++i) { + for(i = pBatch->iDoneUpTo ; i < pBatch->iDoneUpTo + nElem ; ++i) { if( pBatch->pElem[i].state != BATCH_STATE_DISC && pBatch->pElem[i].state != BATCH_STATE_COMM ) { pBatch->pElem[i].state = BATCH_STATE_BAD; @@ -981,7 +981,7 @@ submitBatch(action_t *pAction, batch_t *pBatch, int nElem) bDone = 1; } else { if(nElem == 1) { - batchSetElemState(pBatch, i, BATCH_STATE_BAD); + batchSetElemState(pBatch, pBatch->iDoneUpTo, BATCH_STATE_BAD); bDone = 1; } else { /* retry with half as much. Depth is log_2 batchsize, so recursion is not too deep */ diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index 5ab73184..037e9f84 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -953,8 +953,6 @@ finalize_it: */ void dbgPrintCfSysLineHandlers(void) { - DEFiRet; - cslCmd_t *pCmd; cslCmdHdlr_t *pCmdHdlr; linkedListCookie_t llCookieCmd; @@ -976,7 +974,6 @@ void dbgPrintCfSysLineHandlers(void) } } dbgprintf("\n"); - ENDfunc } diff --git a/runtime/debug.c b/runtime/debug.c index c69a0296..bfc57071 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -157,9 +157,7 @@ static pthread_key_t keyCallStack; */ static void dbgMutexCancelCleanupHdlr(void *pmut) { - int ret; - ret = pthread_mutex_unlock((pthread_mutex_t*) pmut); - assert(ret == 0); + pthread_mutex_unlock((pthread_mutex_t*) pmut); } @@ -473,7 +471,7 @@ static inline void dbgMutexLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB, dbgMutLogDelEntry(pLog); /* add "lock" entry */ - pLog = dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn); + dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn); dbgFuncDBAddMutexLock(pFuncDB, pmut, lockLn); pthread_mutex_unlock(&mutMutLog); if(bPrintMutexAction) @@ -520,7 +518,7 @@ static inline void dbgMutexTryLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncD dbgMutLogDelEntry(pLog); /* add "lock" entry */ - pLog = dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn); + dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn); dbgFuncDBAddMutexLock(pFuncDB, pmut, lockLn); pthread_mutex_unlock(&mutMutLog); if(bPrintMutexAction) diff --git a/runtime/queue.c b/runtime/queue.c index 60d17086..c2806ca1 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1129,7 +1129,7 @@ cancelWorkers(qqueue_t *pThis) * done when *no* worker is running. So time for a shutdown... -- rgerhards, 2009-05-28 */ DBGOPRINT((obj_t*) pThis, "checking to see if main queue DA worker pool needs to be cancelled\n"); - iRetLocal = wtpCancelAll(pThis->pWtpDA); /* returns immediately if all threads already have terminated */ + wtpCancelAll(pThis->pWtpDA); /* returns immediately if all threads already have terminated */ } RETiRet; -- cgit