summaryrefslogtreecommitdiffstats
path: root/runtime/wtp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-26 12:43:43 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-26 12:43:43 +0200
commitaa9426f683fa6af9280bc63050ee0187ba4c57e1 (patch)
tree5ba68517cc2661ab3de4afb417592ed67bdab183 /runtime/wtp.c
parent210f43137d6a077abbd8b77c1f72193dcd81cc99 (diff)
downloadrsyslog-aa9426f683fa6af9280bc63050ee0187ba4c57e1.tar.gz
rsyslog-aa9426f683fa6af9280bc63050ee0187ba4c57e1.tar.xz
rsyslog-aa9426f683fa6af9280bc63050ee0187ba4c57e1.zip
solved design issue with queue termination
... and also improved the test suite. There is a design issue in the v3 queue engine that manifested to some serious problems with the new processing mode. However, in v3 shutdown may take eternally if a queue runs in DA mode, is configured to preserve data AND the action fails and retries immediately. There is no cure available for v3, it would require doing much of the work we have done on the new engine. The window of exposure, as one might guess from the description, is very small. That is probably the reason why we have not seen it in practice.
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r--runtime/wtp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c
index 40a9095b..41fcd8d9 100644
--- a/runtime/wtp.c
+++ b/runtime/wtp.c
@@ -261,16 +261,19 @@ wtpChkStopWrkr(wtp_t *pThis, int bLockMutex, int bLockUsrMutex)
ISOBJ_TYPE_assert(pThis, wtp);
BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, bLockMutex);
- if( (pThis->wtpState == wtpState_SHUTDOWN_IMMEDIATE)
- || ((pThis->wtpState == wtpState_SHUTDOWN) && pThis->pfIsIdle(pThis->pUsr, pThis)))
- iRet = RS_RET_TERMINATE_NOW;
+ if(pThis->wtpState == wtpState_SHUTDOWN_IMMEDIATE) {
+ ABORT_FINALIZE(RS_RET_TERMINATE_NOW);
+ } else if(pThis->wtpState == wtpState_SHUTDOWN) {
+ ABORT_FINALIZE(RS_RET_TERMINATE_WHEN_IDLE);
+ }
/* try customer handler if one was set and we do not yet have a definite result */
- if(iRet == RS_RET_OK && pThis->pfChkStopWrkr != NULL) {
+ if(pThis->pfChkStopWrkr != NULL) {
iRet = pThis->pfChkStopWrkr(pThis->pUsr, bLockUsrMutex);
}
- END_MTX_PROTECTED_OPERATIONS(&pThis->mut);
+finalize_it:
+ END_MTX_PROTECTED_OPERATIONS(&pThis->mut);
RETiRet;
}