Merge pull request #2345 from taosdata/hotfix/rpcAssert

Hotfix/rpc assert
This commit is contained in:
Shengliang Guan 2020-06-18 18:10:52 +08:00 committed by GitHub
commit 4ef4f60b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -576,11 +576,13 @@ 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);
// lockedBy can not be reset, since it maybe hold by a thread
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);
}