From d66a0c35b203266e4b9548dd64fb547833e70177 Mon Sep 17 00:00:00 2001 From: cademfly Date: Tue, 21 Feb 2023 18:15:32 +0800 Subject: [PATCH] fix/TD-22618 --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 8abce50cf0..23a047d49a 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -93,18 +93,30 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { break; } - if (pDnode->status != DND_STAT_RUNNING) { - if (pRpc->msgType == TDMT_DND_SERVER_STATUS) { - dmProcessServerStartupStatus(pDnode, pRpc); - return; - } else { - if (pDnode->status == DND_STAT_INIT) { - terrno = TSDB_CODE_APP_IS_STARTING; +/* +pDnode is null, TD-22618 +at trans.c line 91 +before this line, dmProcessRpcMsg callback is set +after this line, parent is set +so when dmProcessRpcMsg is called, pDonde is still null. +*/ + if (pDnode != NULL){ + if(pDnode->status != DND_STAT_RUNNING) { + if (pRpc->msgType == TDMT_DND_SERVER_STATUS) { + dmProcessServerStartupStatus(pDnode, pRpc); + return; } else { - terrno = TSDB_CODE_APP_IS_STOPPING; + if (pDnode->status == DND_STAT_INIT) { + terrno = TSDB_CODE_APP_IS_STARTING; + } else { + terrno = TSDB_CODE_APP_IS_STOPPING; + } + goto _OVER; } - goto _OVER; - } + } + } else { + terrno = TSDB_CODE_APP_IS_STARTING; + goto _OVER; } if (pRpc->pCont == NULL && (IsReq(pRpc) || pRpc->contLen != 0)) { -- GitLab