diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-06-20 15:01:11 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-06-20 15:01:11 +0200 |
commit | 656740b66307af24d1318d389c3ef0e7095460bc (patch) | |
tree | 59ac6ca192ebebc974922dd86808997060de12fc /action.c | |
parent | b3dae5cff321e066bacc5e03846c77f832004006 (diff) | |
download | rsyslog-656740b66307af24d1318d389c3ef0e7095460bc.tar.gz rsyslog-656740b66307af24d1318d389c3ef0e7095460bc.tar.bz2 rsyslog-656740b66307af24d1318d389c3ef0e7095460bc.zip |
bugfix: problems in failover action handling
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=254
Diffstat (limited to 'action.c')
-rw-r--r-- | action.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -979,11 +979,13 @@ dbgprintf("XXXXX: tryDoAction %p, pnElem %d, nElem %d\n", pAction, *pnElem, if(localRet == RS_RET_OK) { /* mark messages as committed */ while(iCommittedUpTo <= i) { + pBatch->pElem[iCommittedUpTo].bPrevWasSuspended = 0; /* we had success! */ pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM; } } else if(localRet == RS_RET_PREVIOUS_COMMITTED) { /* mark messages as committed */ while(iCommittedUpTo < i) { + pBatch->pElem[iCommittedUpTo].bPrevWasSuspended = 0; /* we had success! */ pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM; } pBatch->pElem[i].state = BATCH_STATE_SUB; @@ -1563,6 +1565,9 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch) } if(pBatch->pElem[i].bFilterOK) bNeedSubmit = 1; + DBGPRINTF("action %p[%d]: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, i, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, + pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); } if(bNeedSubmit) { iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch); @@ -1571,6 +1576,9 @@ doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch) } if(bModifiedFilter) { for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, + pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); /* note: clang static code analyzer reports a false positive below */ pBatch->pElem[i].bFilterOK = pFilterSave[i]; } @@ -1594,21 +1602,17 @@ doSubmitToActionQBatch(action_t *pAction, batch_t *pBatch) int i; DEFiRet; - /* TODO - ich arbeite an dieser funktion, es müssen die verscheidenen modi geprüft werden. ausserdem - muss geschaut werden, in welche anderen funktionen die neue Funktionalität noch eingebaut - werden muss, bzw. ob man das an zentralerer stelle machen kann. Am besten die gesamte - filter evaluation nochmal druchgehen (also das füllen des arrays). - */ - DBGPRINTF("Called action(Batch), logging to %s\n", module.GetStateName(pAction->pMod)); if(pAction->pQueue->qType == QUEUETYPE_DIRECT) { iRet = doQueueEnqObjDirectBatch(pAction, pBatch); - } else { /* in this case, we do single submits to the queue. + } else {/* in this case, we do single submits to the queue. * TODO: optimize this, we may do at least a multi-submit! */ for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, + pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); if( pBatch->pElem[i].bFilterOK && pBatch->pElem[i].state != BATCH_STATE_DISC && (pAction->bExecWhenPrevSusp == 0 || pBatch->pElem[i].bPrevWasSuspended == 1)) { |