fix(stream): check status before start timer.
This commit is contained in:
parent
644f97f1c1
commit
59270dfd0d
|
@ -762,6 +762,13 @@ int32_t streamDispatchStreamBlock(SStreamTask* pTask) {
|
||||||
|
|
||||||
code = sendDispatchMsg(pTask, pTask->msgInfo.pData);
|
code = sendDispatchMsg(pTask, pTask->msgInfo.pData);
|
||||||
|
|
||||||
|
streamMutexLock(&pTask->lock);
|
||||||
|
bool shouldStop = streamTaskShouldStop(pTask);
|
||||||
|
streamMutexLock(&pTask->lock);
|
||||||
|
|
||||||
|
if (shouldStop) {
|
||||||
|
stDebug("s-task:%s in stop/dropping status, not start dispatch monitor tmr", id);
|
||||||
|
} else {
|
||||||
streamMutexLock(&pTask->msgInfo.lock);
|
streamMutexLock(&pTask->msgInfo.lock);
|
||||||
if (pTask->msgInfo.inMonitor == 0) {
|
if (pTask->msgInfo.inMonitor == 0) {
|
||||||
int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1);
|
int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1);
|
||||||
|
@ -774,6 +781,7 @@ int32_t streamDispatchStreamBlock(SStreamTask* pTask) {
|
||||||
}
|
}
|
||||||
|
|
||||||
streamMutexUnlock(&pTask->msgInfo.lock);
|
streamMutexUnlock(&pTask->msgInfo.lock);
|
||||||
|
}
|
||||||
|
|
||||||
// this block can not be deleted until it has been sent to downstream task successfully.
|
// this block can not be deleted until it has been sent to downstream task successfully.
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue