mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-18 05:10:43 +01:00
fixing msg duplication & loss regression, causes slowdown
messages could get lost or be duplicated due to non-proper sync of transactions. This is a notable slowdown again, but we know how to get back concurrency, it just takes "some" more programming. It is important now to come back to correct code, so that we can base further improvements on that.
This commit is contained in:
parent
3e49a1075a
commit
559cb84a79
12
action.c
12
action.c
@ -765,10 +765,10 @@ actionCallDoAction(action_t *pThis, msg_t *pMsg)
|
||||
|
||||
pThis->bHadAutoCommit = 0;
|
||||
#if 1
|
||||
d_pthread_mutex_lock(&pThis->mutActExec);
|
||||
pthread_cleanup_push(mutexCancelCleanup, &pThis->mutActExec);
|
||||
//d_pthread_mutex_lock(&pThis->mutActExec);
|
||||
//pthread_cleanup_push(mutexCancelCleanup, &pThis->mutActExec);
|
||||
iRet = pThis->pMod->mod.om.doAction(ppMsgs, pMsg->msgFlags, pThis->pModData);
|
||||
pthread_cleanup_pop(1); /* unlock mutex */
|
||||
//pthread_cleanup_pop(1); /* unlock mutex */
|
||||
//iRet = pThis->pMod->mod.om.doAction(pThis->ppMsgs, pMsg->msgFlags, pThis->pModData);
|
||||
#else
|
||||
iRet = RS_RET_OK;
|
||||
@ -1051,12 +1051,12 @@ processBatchMain(action_t *pAction, batch_t *pBatch, int *pbShutdownImmediate)
|
||||
* if they notify us they are - functionality not yet implemented...).
|
||||
* rgerhards, 2008-01-30
|
||||
*/
|
||||
// d_pthread_mutex_lock(&pAction->mutActExec);
|
||||
// pthread_cleanup_push(mutexCancelCleanup, &pAction->mutActExec);
|
||||
d_pthread_mutex_lock(&pAction->mutActExec);
|
||||
pthread_cleanup_push(mutexCancelCleanup, &pAction->mutActExec);
|
||||
|
||||
iRet = processAction(pAction, pBatch, pbShutdownImmediate);
|
||||
|
||||
// pthread_cleanup_pop(1); /* unlock mutex */
|
||||
pthread_cleanup_pop(1); /* unlock mutex */
|
||||
|
||||
RETiRet;
|
||||
}
|
||||
|
||||
@ -489,7 +489,7 @@ ParseMsg(msg_t *pMsg)
|
||||
/* we take the risk to print a non-sanitized string, because this is the best we can get
|
||||
* (and that functionality is too important for debugging to drop it...).
|
||||
*/
|
||||
DBGPRINTF("msg parser: flags %x, from '%s', msg '%.50s'\n", pMsg->msgFlags,
|
||||
DBGPRINTF("msg parser: flags %x, from '%s', msg '%.60s'\n", pMsg->msgFlags,
|
||||
(pMsg->msgFlags & NEEDS_DNSRESOL) ? UCHAR_CONSTANT("~NOTRESOLVED~") : getRcvFrom(pMsg),
|
||||
pMsg->pszRawMsg);
|
||||
|
||||
|
||||
@ -614,7 +614,7 @@ doWrite(instanceData *pData, uchar *pszBuf, int lenBuf)
|
||||
ASSERT(pData != NULL);
|
||||
ASSERT(pszBuf != NULL);
|
||||
|
||||
dbgprintf("doWrite, pData->pStrm %p, lenBuf %d\n", pData->pStrm, lenBuf);
|
||||
dbgprintf("write to stream, pData->pStrm %p, lenBuf %d\n", pData->pStrm, lenBuf);
|
||||
if(pData->pStrm != NULL){
|
||||
CHKiRet(strm.Write(pData->pStrm, pszBuf, lenBuf));
|
||||
FINALIZE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user