Merge pull request #2344 from taosdata/hotfix/rpcAssert

dont reset lockedBy
This commit is contained in:
Shengliang Guan 2020-06-18 17:59:04 +08:00 committed by GitHub
commit 6d92d8376a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 11 deletions

View File

@ -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;