free ID in the last step

This commit is contained in:
Jeff Tao 2020-06-18 10:03:33 +00:00
parent fa8af0d996
commit a615527835
1 changed files with 3 additions and 2 deletions

View File

@ -576,11 +576,12 @@ static void rpcReleaseConn(SRpcConn *pConn) {
taosHashRemove(pRpc->hash, hashstr, size);
rpcFreeMsg(pConn->pRspMsg); // it may have a response msg saved, but not request msg
}
taosFreeId(pRpc->idPool, pConn->sid);
int sid = pConn->sid;
int64_t lockedBy = pConn->lockedBy;
memset(pConn, 0, sizeof(SRpcConn));
pConn->lockedBy = lockedBy;
taosFreeId(pRpc->idPool, sid);
tTrace("%s, rpc connection is released", pConn->info);
}