From fa8af0d9961b7f48e2340d2ba796014e74650fe0 Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Thu, 18 Jun 2020 09:55:47 +0000 Subject: [PATCH] dont reset lockedBy --- src/rpc/src/rpcMain.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 989021eb52..365857a14e 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -574,19 +574,13 @@ static void rpcReleaseConn(SRpcConn *pConn) { char hashstr[40] = {0}; size_t size = snprintf(hashstr, sizeof(hashstr), "%x:%x:%x:%d", pConn->peerIp, pConn->linkUid, pConn->peerId, pConn->connType); taosHashRemove(pRpc->hash, hashstr, size); - rpcFreeMsg(pConn->pRspMsg); // it may have a response msg saved, but not request msg - pConn->pRspMsg = NULL; - pConn->inType = 0; - pConn->inTranId = 0; - } else { - pConn->outType = 0; - pConn->outTranId = 0; - pConn->pReqMsg = NULL; - } + } taosFreeId(pRpc->idPool, pConn->sid); - pConn->pContext = NULL; + int64_t lockedBy = pConn->lockedBy; + memset(pConn, 0, sizeof(SRpcConn)); + pConn->lockedBy = lockedBy; tTrace("%s, rpc connection is released", pConn->info); } @@ -611,7 +605,6 @@ static SRpcConn *rpcAllocateClientConn(SRpcInfo *pRpc) { terrno = TSDB_CODE_RPC_MAX_SESSIONS; } else { pConn = pRpc->connList + sid; - memset(pConn, 0, sizeof(SRpcConn)); pConn->pRpc = pRpc; pConn->sid = sid; -- GitLab