From 9dc8bea87ef721befa589c82b129806d3d140710 Mon Sep 17 00:00:00 2001 From: slguan Date: Wed, 1 Apr 2020 19:29:10 +0800 Subject: [PATCH] [TD-17] fix refcount error in query message --- src/dnode/src/dnodeRead.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/dnode/src/dnodeRead.c b/src/dnode/src/dnodeRead.c index cb25cbfd52..1c3e3a8638 100644 --- a/src/dnode/src/dnodeRead.c +++ b/src/dnode/src/dnodeRead.c @@ -77,15 +77,8 @@ void dnodeRead(SRpcMsg *pMsg) { char *pCont = (char *) pMsg->pCont; SRpcContext *pRpcContext = NULL; - dTrace("dnode read msg disposal"); - -// SMsgDesc *pDesc = pCont; -// pDesc->numOfVnodes = htonl(pDesc->numOfVnodes); -// pCont += sizeof(SMsgDesc); -// if (pDesc->numOfVnodes > 1) { -// pRpcContext = calloc(sizeof(SRpcContext), 1); -// pRpcContext->numOfVnodes = pDesc->numOfVnodes; -// } + dTrace("dnode %s msg incoming, thandle:%p", taosMsg[pMsg->msgType], pMsg->handle); + if (pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE) { queuedMsgNum = 0; } @@ -176,10 +169,7 @@ static void *dnodeProcessReadQueue(void *param) { terrno = TSDB_CODE_MSG_NOT_PROCESSED; } -// dnodeProcessReadResult(pVnode, pReadMsg); taosFreeQitem(pReadMsg); - - dnodeReleaseVnode(pVnode); } return NULL; @@ -201,8 +191,6 @@ static void dnodeProcessReadResult(void *pVnode, SReadMsg *pRead) { SRpcContext *pRpcContext = pRead->pRpcContext; int32_t code = 0; - dnodeReleaseVnode(pVnode); - if (pRpcContext) { if (terrno) { if (pRpcContext->code == 0) pRpcContext->code = terrno; @@ -266,6 +254,8 @@ static void dnodeProcessQueryMsg(void *pVnode, SReadMsg *pMsg) { }; rpcSendResponse(&rpcRsp); + dTrace("dnode query msg disposed, thandle:%p", pMsg->rpcMsg.handle); + dnodeReleaseVnode(pVnode); } else { pQInfo = pMsg->pCont; } @@ -308,4 +298,6 @@ static void dnodeProcessRetrieveMsg(void *pVnode, SReadMsg *pMsg) { }; rpcSendResponse(&rpcRsp); + dTrace("dnode retrieve msg disposed, thandle:%p", pMsg->rpcMsg.handle); + dnodeReleaseVnode(pVnode); } -- GitLab