Merge pull request #3598 from taosdata/feature/query

[td-225] fix bugs in regression test.
This commit is contained in:
haojun Liao 2020-09-21 13:21:22 +08:00 committed by GitHub
commit f0db62241c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 25 deletions

View File

@ -188,8 +188,8 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
if (tscShouldFreeHeartBeat(pHB)) { if (tscShouldFreeHeartBeat(pHB)) {
tscDebug("%p free HB object and release connection", pHB); tscDebug("%p free HB object and release connection", pHB);
tscFreeSqlObj(pHB); pObj->pHb = 0;
tscCloseTscObj(pObj); taos_free_result(pHB);
} else { } else {
int32_t code = tscProcessSql(pHB); int32_t code = tscProcessSql(pHB);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {

View File

@ -263,33 +263,16 @@ void taos_close(TAOS *taos) {
return; return;
} }
if (pObj->pHb != NULL) { SSqlObj* pHb = pObj->pHb;
if (pObj->pHb->pRpcCtx != NULL) { // wait for rsp from dnode if (pHb != NULL) {
rpcCancelRequest(pObj->pHb->pRpcCtx); if (pHb->pRpcCtx != NULL) { // wait for rsp from dnode
rpcCancelRequest(pHb->pRpcCtx);
} }
tscSetFreeHeatBeat(pObj); pObj->pHb = NULL;
tscFreeSqlObj(pObj->pHb); taos_free_result(pHb);
} }
// free all sqlObjs created by using this connect before free the STscObj
// while(1) {
// pthread_mutex_lock(&pObj->mutex);
// void* p = pObj->sqlList;
// pthread_mutex_unlock(&pObj->mutex);
//
// if (p == NULL) {
// break;
// }
//
// tscDebug("%p waiting for sqlObj to be freed, %p", pObj, p);
// taosMsleep(100);
//
// // todo fix me!! two threads call taos_free_result will cause problem.
// tscDebug("%p free :%p", pObj, p);
// taos_free_result(p);
// }
int32_t ref = T_REF_DEC(pObj); int32_t ref = T_REF_DEC(pObj);
assert(ref >= 0); assert(ref >= 0);