diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index ea6845b04f7b38afd28f2dbb78419cb1728bcf43..21776d71f6280b4a24f68ad3f6409268c171ab5d 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -195,6 +195,8 @@ static int32_t dmRunDnode() { int32_t code = dmRun(pDnode); dInfo("start shutting down the service"); + global.pDnode = NULL; + dmClose(pDnode); dmCleanup(); taosCloseLog(); taosCleanupCfg(); diff --git a/source/dnode/mgmt/node_mgmt/src/dmExec.c b/source/dnode/mgmt/node_mgmt/src/dmExec.c index b1c7158cd9d250e6016fd35d101bdfdc1641e1d0..7fb89de59ea29e46c98f7b6cc3d12d0cde3f5d2c 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmExec.c +++ b/source/dnode/mgmt/node_mgmt/src/dmExec.c @@ -337,7 +337,6 @@ int32_t dmRun(SDnode *pDnode) { dmSetStatus(pDnode, DND_STAT_STOPPED); dmStopNodes(pDnode); dmCloseNodes(pDnode); - dmClose(pDnode); return 0; } else { dmWatchNodes(pDnode);