fix: clean up udfs is not executed when no udfs
This commit is contained in:
parent
fa428fc6fb
commit
f71cb30dd0
|
@ -442,7 +442,7 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds) {
|
||||||
*useconds = pTaskInfo->cost.elapsedTime;
|
*useconds = pTaskInfo->cost.elapsedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
//cleanUpUdfs();
|
cleanUpUdfs();
|
||||||
|
|
||||||
int32_t current = (*pRes != NULL) ? (*pRes)->info.rows : 0;
|
int32_t current = (*pRes != NULL) ? (*pRes)->info.rows : 0;
|
||||||
uint64_t total = pTaskInfo->pRoot->resultInfo.totalRows;
|
uint64_t total = pTaskInfo->pRoot->resultInfo.totalRows;
|
||||||
|
|
|
@ -976,8 +976,12 @@ int32_t cleanUpUdfs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
uv_mutex_lock(&gUdfdProxy.udfStubsMutex);
|
uv_mutex_lock(&gUdfdProxy.udfStubsMutex);
|
||||||
int32_t i = 0;
|
if (gUdfdProxy.udfStubs == NULL || taosArrayGetSize(gUdfdProxy.udfStubs) == 0) {
|
||||||
|
uv_mutex_unlock(&gUdfdProxy.udfStubsMutex);
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
SArray* udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub));
|
SArray* udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub));
|
||||||
|
int32_t i = 0;
|
||||||
while (i < taosArrayGetSize(gUdfdProxy.udfStubs)) {
|
while (i < taosArrayGetSize(gUdfdProxy.udfStubs)) {
|
||||||
SUdfcFuncStub *stub = taosArrayGet(gUdfdProxy.udfStubs, i);
|
SUdfcFuncStub *stub = taosArrayGet(gUdfdProxy.udfStubs, i);
|
||||||
if (stub->refCount == 0) {
|
if (stub->refCount == 0) {
|
||||||
|
|
Loading…
Reference in New Issue