Merge pull request #15701 from taosdata/szhou/fix/udf

fix: clean up udfs is not executed when no udfs
This commit is contained in:
shenglian-zhou 2022-08-03 12:01:31 +08:00 committed by GitHub
commit cf143ab993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -976,8 +976,12 @@ int32_t cleanUpUdfs() {
}
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));
int32_t i = 0;
while (i < taosArrayGetSize(gUdfdProxy.udfStubs)) {
SUdfcFuncStub *stub = taosArrayGet(gUdfdProxy.udfStubs, i);
if (stub->refCount == 0) {