未验证 提交 0e215134 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #21334 from taosdata/enh/TD-23421-M

fix: client HB logic
...@@ -791,27 +791,20 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) { ...@@ -791,27 +791,20 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
return NULL; return NULL;
} }
int64_t rid = -1; void *pIter = NULL;
int32_t code = 0; SHbParam param = {0};
while ((pIter = taosHashIterate(pAppHbMgr->activeInfo, pIter))) {
void *pIter = taosHashIterate(pAppHbMgr->activeInfo, NULL);
SClientHbReq *pOneReq = pIter; SClientHbReq *pOneReq = pIter;
SClientHbKey *connKey = pOneReq ? &pOneReq->connKey : NULL; SClientHbKey *connKey = &pOneReq->connKey;
if (connKey != NULL) rid = connKey->tscRid; STscObj *pTscObj = (STscObj *)acquireTscObj(connKey->tscRid);
STscObj *pTscObj = (STscObj *)acquireTscObj(rid); if (!pTscObj) {
if (pTscObj == NULL) { continue;
tFreeClientHbBatchReq(pBatchReq);
return NULL;
} }
SHbParam param = {0};
while (pIter != NULL) {
pOneReq = taosArrayPush(pBatchReq->reqs, pOneReq); pOneReq = taosArrayPush(pBatchReq->reqs, pOneReq);
switch (pOneReq->connKey.connType) { switch (connKey->connType) {
case CONN_TYPE__QUERY: { case CONN_TYPE__QUERY: {
if (param.clusterId == 0) { if (param.clusterId == 0) {
// init // init
...@@ -824,24 +817,16 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) { ...@@ -824,24 +817,16 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
default: default:
break; break;
} }
if (clientHbMgr.reqHandle[pOneReq->connKey.connType]) { if (clientHbMgr.reqHandle[connKey->connType]) {
code = (*clientHbMgr.reqHandle[pOneReq->connKey.connType])(&pOneReq->connKey, &param, pOneReq); int32_t code = (*clientHbMgr.reqHandle[connKey->connType])(connKey, &param, pOneReq);
if (code) { if (code) {
tscWarn("hbGatherAllInfo failed since %s, tscRid:%" PRIi64 ", connType:%" PRIi8, tstrerror(code), tscWarn("hbGatherAllInfo failed since %s, tscRid:%" PRIi64 ", connType:%" PRIi8, tstrerror(code),
pOneReq->connKey.tscRid, pOneReq->connKey.connType); connKey->tscRid, connKey->connType);
}
} }
if (code) {
pIter = taosHashIterate(pAppHbMgr->activeInfo, pIter);
pOneReq = pIter;
continue;
} }
pIter = taosHashIterate(pAppHbMgr->activeInfo, pIter); releaseTscObj(connKey->tscRid);
pOneReq = pIter;
} }
releaseTscObj(rid);
return pBatchReq; return pBatchReq;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册