diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index d971e3ad6dc2a20c241c0ba1ea5aac12dfa878f8..7cc4bbcefa0bf0665354a84012936bfac492fb74 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -721,7 +721,7 @@ int32_t dnodeGetDnodeId() { } void dnodeSendRedirectMsg(SRpcMsg *rpcMsg, bool forShell) { - SRpcConnInfo connInfo; + SRpcConnInfo connInfo = {0}; rpcGetConnInfo(rpcMsg->handle, &connInfo); SRpcIpSet ipSet = {0}; diff --git a/src/mnode/src/mnodeMain.c b/src/mnode/src/mnodeMain.c index 96dc70078315ba3ab088fb201088189853f6ec54..5e44ea573129b2fa1a224440dc3a6e2eee556b1a 100644 --- a/src/mnode/src/mnodeMain.c +++ b/src/mnode/src/mnodeMain.c @@ -121,8 +121,8 @@ void mnodeCleanupSystem() { dnodeFreeMnodeWqueue(); dnodeFreeMnodeRqueue(); dnodeFreeMnodePqueue(); - mnodeCleanupTimer(); mnodeCleanupComponents(sizeof(tsMnodeComponents) / sizeof(tsMnodeComponents[0]) - 1); + mnodeCleanupTimer(); mPrint("mnode is cleaned up"); } diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 9a4509f8e1347b36e580edd85488d077fb74008b..e9ddd89467f082555484ce944d18f7b5f5713b0c 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -819,7 +819,8 @@ static int rpcProcessRspHead(SRpcConn *pConn, SRpcHead *pHead) { tTrace("%s, authentication shall be restarted", pConn->info); pConn->secured = 0; rpcSendMsgToPeer(pConn, pConn->pReqMsg, pConn->reqMsgLen); - pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl); + if (pConn->connType != RPC_CONN_TCPC) + pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl); return TSDB_CODE_RPC_ALREADY_PROCESSED; } @@ -828,7 +829,8 @@ static int rpcProcessRspHead(SRpcConn *pConn, SRpcHead *pHead) { tTrace("%s, peer is still processing the transaction, retry:%d", pConn->info, pConn->tretry); pConn->tretry++; rpcSendReqHead(pConn); - pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl); + if (pConn->connType != RPC_CONN_TCPC) + pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl); return TSDB_CODE_RPC_ALREADY_PROCESSED; } else { // peer still in processing, give up @@ -896,8 +898,12 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) { terrno = rpcProcessReqHead(pConn, pHead); pConn->connType = pRecv->connType; - // client shall send the request within tsRpcTime again, double it - taosTmrReset(rpcProcessIdleTimer, tsRpcTimer*2, pConn, pRpc->tmrCtrl, &pConn->pIdleTimer); + // stop idle timer + taosTmrStopA(&pConn->pIdleTimer); + + // client shall send the request within tsRpcTime again for UDP, double it + if (pConn->connType != RPC_CONN_TCPS) + pConn->pIdleTimer = taosTmrStart(rpcProcessIdleTimer, tsRpcTimer*2, pConn, pRpc->tmrCtrl); } else { terrno = rpcProcessRspHead(pConn, pHead); } @@ -1024,7 +1030,8 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) { rpcAddRef(pRpc); // add the refCount for requests // start the progress timer to monitor the response from server app - pConn->pTimer = taosTmrStart(rpcProcessProgressTimer, tsProgressTimer, pConn, pRpc->tmrCtrl); + if (pConn->connType != RPC_CONN_TCPS) + pConn->pTimer = taosTmrStart(rpcProcessProgressTimer, tsProgressTimer, pConn, pRpc->tmrCtrl); // notify the server app (*(pRpc->cfp))(&rpcMsg, NULL); @@ -1056,9 +1063,11 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) { for (int i=0; iipSet.numOfIps; ++i) pContext->ipSet.port[i] = htons(pContext->ipSet.port[i]); rpcSendReqToServer(pRpc, pContext); + rpcFreeCont(rpcMsg.pCont); } else if (pHead->code == TSDB_CODE_RPC_NOT_READY) { pContext->code = pHead->code; rpcProcessConnError(pContext, NULL); + rpcFreeCont(rpcMsg.pCont); } else { rpcNotifyClient(pContext, &rpcMsg); } @@ -1187,7 +1196,8 @@ static void rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) { pConn->pContext = pContext; rpcSendMsgToPeer(pConn, msg, msgLen); - taosTmrReset(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl, &pConn->pTimer); + if (pConn->connType != RPC_CONN_TCPC) + taosTmrReset(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl, &pConn->pTimer); rpcUnlockConn(pConn); }