From 306cd7bef392238400fb79e8be3b0da52e6be653 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 1 Mar 2022 18:09:43 +0800 Subject: [PATCH 1/2] add hb back --- source/client/src/clientHb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index dcb30a6576..c7e329c6e6 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -448,7 +448,7 @@ static void hbStopThread() { } SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) { - return NULL; + /*return NULL;*/ hbMgrInit(); SAppHbMgr *pAppHbMgr = malloc(sizeof(SAppHbMgr)); if (pAppHbMgr == NULL) { @@ -506,7 +506,7 @@ void appHbMgrCleanup(void) { } int hbMgrInit() { - return 0; + /*return 0;*/ // init once int8_t old = atomic_val_compare_exchange_8(&clientHbMgr.inited, 0, 1); if (old == 1) return 0; @@ -524,7 +524,7 @@ int hbMgrInit() { } void hbMgrCleanUp() { - return; + /*return;*/ hbStopThread(); // destroy all appHbMgr @@ -563,7 +563,7 @@ int hbRegisterConnImpl(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, SHbConnInfo * } int hbRegisterConn(SAppHbMgr *pAppHbMgr, int32_t connId, int64_t clusterId, int32_t hbType) { - return 0; + /*return 0;*/ SClientHbKey connKey = {.connId = connId, .hbType = HEARTBEAT_TYPE_QUERY}; SHbConnInfo info = {0}; @@ -586,7 +586,7 @@ int hbRegisterConn(SAppHbMgr *pAppHbMgr, int32_t connId, int64_t clusterId, int3 } void hbDeregisterConn(SAppHbMgr *pAppHbMgr, SClientHbKey connKey) { - return; + /*return;*/ int32_t code = 0; code = taosHashRemove(pAppHbMgr->activeInfo, &connKey, sizeof(SClientHbKey)); code = taosHashRemove(pAppHbMgr->connInfo, &connKey, sizeof(SClientHbKey)); From 6a6bab9e9865284e9ca06b1862fac3b985729da8 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 1 Mar 2022 19:17:35 +0800 Subject: [PATCH 2/2] fix hb crash --- source/common/src/tmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 8a3cd0a718..34b2932f9a 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -270,7 +270,7 @@ int32_t tDeserializeSClientHbBatchRsp(void *buf, int32_t bufLen, SClientHbBatchR int32_t rspNum = 0; if (tDecodeI32(&decoder, &rspNum) < 0) return -1; if (pBatchRsp->rsps == NULL) { - pBatchRsp->rsps = taosArrayInit(rspNum, sizeof(SClientHbReq)); + pBatchRsp->rsps = taosArrayInit(rspNum, sizeof(SClientHbRsp)); } for (int32_t i = 0; i < rspNum; i++) { SClientHbRsp rsp = {0}; @@ -1527,7 +1527,7 @@ int32_t tDeserializeSUseDbRspImp(SCoder *pDecoder, SUseDbRsp *pRsp) { if (pRsp->vgNum <= 0) { return 0; } - + pRsp->pVgroupInfos = taosArrayInit(pRsp->vgNum, sizeof(SVgroupInfo)); if (pRsp->pVgroupInfos == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY;