refactor: node mgmt

This commit is contained in:
Shengliang Guan 2022-05-12 17:12:40 +08:00
parent 447c9504a3
commit dd87e8f7b9
3 changed files with 11 additions and 9 deletions

View File

@ -195,8 +195,6 @@ static int32_t dmRunDnode() {
int32_t code = dmRun(pDnode);
dInfo("start shutting down the service");
global.pDnode = NULL;
dmClose(pDnode);
dmCleanup();
taosCloseLog();
taosCleanupCfg();

View File

@ -203,7 +203,10 @@ void dmCloseNode(SMgmtWrapper *pWrapper) {
}
taosWLockLatch(&pWrapper->latch);
if (pWrapper->pMgmt != NULL) {
(*pWrapper->func.closeFp)(pWrapper->pMgmt);
pWrapper->pMgmt = NULL;
}
taosWUnLockLatch(&pWrapper->latch);
if (pWrapper->procObj) {
@ -334,6 +337,7 @@ int32_t dmRun(SDnode *pDnode) {
dmSetStatus(pDnode, DND_STAT_STOPPED);
dmStopNodes(pDnode);
dmCloseNodes(pDnode);
dmClose(pDnode);
return 0;
} else {
dmWatchNodes(pDnode);