fix(stream): fix race condition when starting check downstream status and dropping task are executed concurrently.
This commit is contained in:
parent
651077866e
commit
70191f6a5d
|
@ -280,6 +280,13 @@ void streamTaskStartMonitorCheckRsp(SStreamTask* pTask) {
|
|||
|
||||
streamMutexLock(&pInfo->checkInfoLock);
|
||||
|
||||
// drop procedure already started, not start check downstream now
|
||||
ETaskStatus s = streamTaskGetStatus(pTask).state;
|
||||
if (s == TASK_STATUS__DROPPING) {
|
||||
streamMutexUnlock(&pInfo->checkInfoLock);
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t code = streamTaskStartCheckDownstream(pInfo, pTask->id.idStr);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
streamMutexUnlock(&pInfo->checkInfoLock);
|
||||
|
|
|
@ -742,7 +742,10 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t
|
|||
streamMetaRLock(pMeta);
|
||||
ppTask = (SStreamTask**)taosHashGet(pMeta->pTasksMap, &id, sizeof(id));
|
||||
if (ppTask) {
|
||||
// to make sure check status will not start the check downstream status when we start to check timerActive count.
|
||||
streamMutexLock(&pTask->taskCheckInfo.checkInfoLock);
|
||||
timerActive = (*ppTask)->status.timerActive;
|
||||
streamMutexUnlock(&pTask->taskCheckInfo.checkInfoLock);
|
||||
}
|
||||
streamMetaRUnLock(pMeta);
|
||||
|
||||
|
|
Loading…
Reference in New Issue