diff --git a/source/libs/scheduler/src/schStatus.c b/source/libs/scheduler/src/schStatus.c index 80137f1872..091b1359e0 100644 --- a/source/libs/scheduler/src/schStatus.c +++ b/source/libs/scheduler/src/schStatus.c @@ -40,7 +40,7 @@ int32_t schSwitchJobStatus(SSchJob* pJob, int32_t status, void* param) { SCH_RET(schProcessOnJobFailure(pJob, (param ? *(int32_t*)param : 0))); break; case JOB_TASK_STATUS_DROP: - SCH_ERR_JRET(schProcessOnJobDropped(pJob, *(int32_t*)param)); + schProcessOnJobDropped(pJob, *(int32_t*)param); if (taosRemoveRef(schMgmt.jobRef, pJob->refId)) { SCH_JOB_ELOG("remove job from job list failed, refId:0x%" PRIx64, pJob->refId); diff --git a/source/libs/scheduler/src/scheduler.c b/source/libs/scheduler/src/scheduler.c index ebc4014e88..82e017e309 100644 --- a/source/libs/scheduler/src/scheduler.c +++ b/source/libs/scheduler/src/scheduler.c @@ -144,11 +144,9 @@ void schedulerFreeJob(int64_t* jobId, int32_t errCode) { return; } - if (schJobDone(pJob)) { - return; - } - schSwitchJobStatus(pJob, JOB_TASK_STATUS_DROP, (void*)&errCode); + + schReleaseJob(*jobId); *jobId = 0; }