[td-1641]
This commit is contained in:
parent
df2d6ea1c0
commit
da9bf993bd
|
@ -207,8 +207,6 @@ void tscTagCondRelease(STagCond* pCond);
|
|||
|
||||
void tscGetSrcColumnInfo(SSrcColumnInfo* pColInfo, SQueryInfo* pQueryInfo);
|
||||
|
||||
void tscSetFreeHeatBeat(STscObj* pObj);
|
||||
bool tscShouldFreeHeartBeat(SSqlObj* pHb);
|
||||
bool tscShouldBeFreed(SSqlObj* pSql);
|
||||
|
||||
STableMetaInfo* tscGetTableMetaInfoFromCmd(SSqlCmd *pCmd, int32_t subClauseIndex, int32_t tableIndex);
|
||||
|
|
|
@ -198,16 +198,20 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (tscShouldFreeHeartBeat(pHB)) {
|
||||
tscDebug("%p free HB object and release connection", pHB);
|
||||
pObj->pHb = 0;
|
||||
taos_free_result(pHB);
|
||||
} else {
|
||||
void** p = taosCacheAcquireByKey(tscObjCache, &pHB->self, sizeof(TSDB_CACHE_PTR_TYPE));
|
||||
if (p == NULL) {
|
||||
tscWarn("%p HB object has been released already", pHB);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(*pHB->self == pHB);
|
||||
|
||||
int32_t code = tscProcessSql(pHB);
|
||||
taosCacheRelease(tscObjCache, (void**) &p, false);
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscError("%p failed to sent HB to server, reason:%s", pHB, tstrerror(code));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int tscSendMsgToServer(SSqlObj *pSql) {
|
||||
|
|
|
@ -1516,13 +1516,6 @@ void tscSetFreeHeatBeat(STscObj* pObj) {
|
|||
pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE;
|
||||
}
|
||||
|
||||
bool tscShouldFreeHeartBeat(SSqlObj* pHb) {
|
||||
assert(pHb == pHb->signature);
|
||||
|
||||
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pHb->cmd, 0);
|
||||
return pQueryInfo->type == TSDB_QUERY_TYPE_FREE_RESOURCE;
|
||||
}
|
||||
|
||||
/*
|
||||
* the following four kinds of SqlObj should not be freed
|
||||
* 1. SqlObj for stream computing
|
||||
|
|
Loading…
Reference in New Issue