Merge pull request #4690 from taosdata/hotfix/TD-2548

[TD-2548]<fix>:wrong error message is showed when taos connect failed
This commit is contained in:
haojun Liao 2020-12-24 10:47:00 +08:00 committed by GitHub
commit 6f1b97472c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -284,9 +284,10 @@ void taos_close(TAOS *taos) {
return;
}
if (RID_VALID(pObj->hbrid)) {
SSqlObj* pHb = (SSqlObj*)taosAcquireRef(tscObjRef, pObj->hbrid);
if (pHb != NULL) {
if (pHb->rpcRid > 0) { // wait for rsp from dnode
if (RID_VALID(pHb->rpcRid)) { // wait for rsp from dnode
rpcCancelRequest(pHb->rpcRid);
pHb->rpcRid = -1;
}
@ -295,6 +296,7 @@ void taos_close(TAOS *taos) {
taosReleaseRef(tscObjRef, pHb->self);
taos_free_result(pHb);
}
}
tscDebug("%p all sqlObj are freed, free tscObj and close dnodeConn:%p", pObj, pObj->pDnodeConn);
taosRemoveRef(tscRefId, pObj->rid);

View File

@ -52,6 +52,8 @@ void *taosIterateRef(int rsetId, int64_t rid);
// return the number of references in system
int taosListRef();
#define RID_VALID(x) ((x) > 0)
/* sample code to iterate the refs
void demoIterateRefs(int rsetId) {