提交 0a1e96ec 编写于 作者: S Shengliang Guan

refactor: multi-process test mode

上级 23707bfc
...@@ -70,8 +70,9 @@ static int32_t dmCheckRepeatCleanup(SDnode *pDnode) { ...@@ -70,8 +70,9 @@ static int32_t dmCheckRepeatCleanup(SDnode *pDnode) {
void dmCleanup() { void dmCleanup() {
dDebug("start to cleanup env"); dDebug("start to cleanup env");
if (dmCheckRepeatCleanup != 0) return; SDnode *pDnode = dmInstance();
dmCleanupDnode(dmInstance()); if (dmCheckRepeatCleanup(pDnode) != 0) return;
dmCleanupDnode(pDnode);
monCleanup(); monCleanup();
syncCleanUp(); syncCleanUp();
walCleanUp(); walCleanUp();
......
...@@ -25,9 +25,18 @@ static bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper) { ...@@ -25,9 +25,18 @@ static bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper) {
dDebug("node:%s, does not require startup", pWrapper->name); dDebug("node:%s, does not require startup", pWrapper->name);
} }
if (pWrapper->ntype == DNODE && pDnode->rtype != DNODE && pDnode->rtype != NODE_END) { if (pWrapper->ntype == DNODE) {
required = false; if (pDnode->rtype != DNODE && pDnode->rtype != NODE_END) {
dDebug("node:%s, does not require startup in child process", pWrapper->name); required = false;
dDebug("node:%s, does not require startup in child process", pWrapper->name);
}
} else {
if (OnlyInChildProc(pWrapper)) {
if (pWrapper->ntype != pDnode->rtype) {
dDebug("node:%s, does not require startup in child process", pWrapper->name);
required = false;
}
}
} }
if (required) { if (required) {
...@@ -111,7 +120,6 @@ static void dmClearVars(SDnode *pDnode) { ...@@ -111,7 +120,6 @@ static void dmClearVars(SDnode *pDnode) {
taosThreadMutexDestroy(&pDnode->mutex); taosThreadMutexDestroy(&pDnode->mutex);
memset(&pDnode->mutex, 0, sizeof(pDnode->mutex)); memset(&pDnode->mutex, 0, sizeof(pDnode->mutex));
taosMemoryFree(pDnode);
} }
int32_t dmInitDnode(SDnode *pDnode, EDndNodeType rtype) { int32_t dmInitDnode(SDnode *pDnode, EDndNodeType rtype) {
......
...@@ -392,12 +392,13 @@ static void *dmConsumParentQueue(void *param) { ...@@ -392,12 +392,13 @@ static void *dmConsumParentQueue(void *param) {
rpcSendResponse(pRsp); rpcSendResponse(pRsp);
} else if (ftype == DND_FUNC_REGIST) { } else if (ftype == DND_FUNC_REGIST) {
pRsp = pHead; pRsp = pHead;
pRsp->pCont = pBody;
dTrace("node:%s, get regist msg:%p from pqueue, code:0x%04x handle:%p", proc->name, pRsp, code, dTrace("node:%s, get regist msg:%p from pqueue, code:0x%04x handle:%p", proc->name, pRsp, code,
pRsp->info.handle); pRsp->info.handle);
rpcRegisterBrokenLinkArg(pRsp); rpcRegisterBrokenLinkArg(pRsp);
rpcFreeCont(pBody);
} else if (ftype == DND_FUNC_RELEASE) { } else if (ftype == DND_FUNC_RELEASE) {
pRsp = pHead; pRsp = pHead;
pRsp->pCont = NULL;
dTrace("node:%s, get release msg:%p from pqueue, code:0x%04x handle:%p", proc->name, pRsp, code, dTrace("node:%s, get release msg:%p from pqueue, code:0x%04x handle:%p", proc->name, pRsp, code,
pRsp->info.handle); pRsp->info.handle);
dmRemoveProcRpcHandle(proc, pRsp->info.handle); dmRemoveProcRpcHandle(proc, pRsp->info.handle);
......
...@@ -43,6 +43,7 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) { ...@@ -43,6 +43,7 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
return -1; return -1;
} }
pMsg->info.wrapper = pWrapper;
dTrace("msg:%p, will be processed by %s, handle:%p", pMsg, pWrapper->name, pMsg->info.handle); dTrace("msg:%p, will be processed by %s, handle:%p", pMsg, pWrapper->name, pMsg->info.handle);
return (*msgFp)(pWrapper->pMgmt, pMsg); return (*msgFp)(pWrapper->pMgmt, pMsg);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册