From d044a4ee8195fa6e838ae53cad5c23a533d8da7c Mon Sep 17 00:00:00 2001 From: slzhou Date: Thu, 21 Apr 2022 11:21:27 +0800 Subject: [PATCH] fix bug that udfd can not be spawned --- source/dnode/mgmt/implement/src/dmHandle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/mgmt/implement/src/dmHandle.c b/source/dnode/mgmt/implement/src/dmHandle.c index 2acaaccb43..df1ab79b99 100644 --- a/source/dnode/mgmt/implement/src/dmHandle.c +++ b/source/dnode/mgmt/implement/src/dmHandle.c @@ -233,10 +233,7 @@ static int32_t dmSpawnUdfd(SDnodeData *pData) { dInfo("dnode start spawning udfd"); uv_process_options_t options = {0}; - char path[PATH_MAX] = {0}; - size_t cwdSize; - uv_cwd(path, &cwdSize); - strcat(path, "/udfd"); + char path[] = "udfd"; char* argsUdfd[] = {path, "-c", configDir, NULL}; options.args = argsUdfd; options.file = path; @@ -295,6 +292,9 @@ int32_t dmStartUdfd(SDnode *pDnode) { int32_t dmStopUdfd(SDnode *pDnode) { SDnodeData *pData = &pDnode->data; + if (pData->udfdErrCode != 0) { + return 0; + } atomic_store_8(&pData->udfdStoping, 1); uv_barrier_destroy(&pData->udfdBarrier);