From c2c74b82a3273fcb42630337299ebcb82f6df544 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 10 Feb 2022 16:06:26 +0800 Subject: [PATCH] null handle in rpc --- source/dnode/mnode/impl/src/mnode.c | 2 ++ source/libs/transport/src/rpcMain.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/src/mnode.c b/source/dnode/mnode/impl/src/mnode.c index e57ee3eabc..92e4d44b77 100644 --- a/source/dnode/mnode/impl/src/mnode.c +++ b/source/dnode/mnode/impl/src/mnode.c @@ -461,6 +461,8 @@ void mndProcessMsg(SMnodeMsg *pMsg) { PROCESS_RPC_END: if (isReq) { + if (pMsg->rpcMsg.handle == NULL) return; + if (code == TSDB_CODE_APP_NOT_READY) { mndSendRedirectRsp(pMnode, &pMsg->rpcMsg); } else if (code != 0) { diff --git a/source/libs/transport/src/rpcMain.c b/source/libs/transport/src/rpcMain.c index f5e9153098..3bb7d103d7 100644 --- a/source/libs/transport/src/rpcMain.c +++ b/source/libs/transport/src/rpcMain.c @@ -419,7 +419,7 @@ void rpcSendRequest(void *shandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t } void rpcSendResponse(const SRpcMsg *pRsp) { - if (pRsp->handle == NULL) return; + ASSERT(pRsp->handle != NULL); int msgLen = 0; SRpcConn *pConn = (SRpcConn *)pRsp->handle;