• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #4513

17 Jul 2025 02:02AM UTC coverage: 31.359% (-31.1%) from 62.446%
#4513

push

travis-ci

web-flow
Merge pull request #31914 from taosdata/fix/3.0/compare-ans-failed

fix:Convert line endings from LF to CRLF for ans file

68541 of 301034 branches covered (22.77%)

Branch coverage included in aggregate %.

117356 of 291771 relevant lines covered (40.22%)

602262.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.73
/source/dnode/mnode/impl/src/mndStreamHb.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#include "mndStream.h"
17
#include "mndTrans.h"
18
#include "mndMnode.h"
19
#include "tmisce.h"
20

21

22
void mndStreamHbSendRsp(SRpcHandleInfo *pRpcInfo, SRpcMsg* pRsp) {
50✔
23
  tmsgSendRsp(pRsp);
50✔
24
  pRpcInfo->handle = NULL;  // disable auto rsp
50✔
25
}
50✔
26

27
int32_t mndProcessStreamHb(SRpcMsg *pReq) {
50✔
28
  SMnode      *pMnode = pReq->info.node;
50✔
29
  SStreamHbMsg req = {0};
50✔
30
  SMStreamHbRspMsg rsp = {0};
50✔
31
  int32_t      code = 0;
50✔
32
  int32_t      lino = 0;
50✔
33
  SDecoder     decoder = {0};
50✔
34
  char*        msg = POINTER_SHIFT(pReq->pCont, sizeof(SStreamMsgGrpHeader));
50✔
35
  int32_t      len = pReq->contLen - sizeof(SStreamMsgGrpHeader);
50✔
36
  int64_t      currTs = taosGetTimestampMs();
50✔
37

38
  mstDebug("start to process stream hb req msg");
50✔
39

40
  if ((code = grantCheckExpire(TSDB_GRANT_STREAMS)) < 0) {
50!
41
    TAOS_CHECK_EXIT(msmHandleGrantExpired(pMnode));
×
42
  }
43

44
  tDecoderInit(&decoder, msg, len);
50✔
45
  code = tDecodeStreamHbMsg(&decoder, &req);
50✔
46
  if (code < 0) {
50!
47
    mstError("failed to decode stream hb msg, error:%s", tstrerror(terrno));
×
48
    tCleanupStreamHbMsg(&req, true);
×
49
    tDecoderClear(&decoder);
×
50
    TAOS_CHECK_EXIT(TSDB_CODE_INVALID_MSG);
×
51
  }
52
  tDecoderClear(&decoder);
50✔
53

54
  mstDebug("start to process grp %d stream-hb from dnode:%d, snodeId:%d, vgLeaders:%d, streamStatus:%d", 
50✔
55
      req.streamGId, req.dnodeId, req.snodeId, (int32_t)taosArrayGetSize(req.pVgLeaders), (int32_t)taosArrayGetSize(req.pStreamStatus));
56

57
  rsp.streamGId = req.streamGId;
50✔
58

59
  SRpcMsg rspMsg = {0};
50✔
60
  
61
  (void)msmHandleStreamHbMsg(pMnode, currTs, &req, pReq, &rspMsg);
50✔
62

63
_exit:
50✔
64

65
  if (code) {
50!
66
    msmEncodeStreamHbRsp(code, &pReq->info, &rsp, &rspMsg);
×
67
  }
68
  
69
  mndStreamHbSendRsp(&pReq->info, &rspMsg);
50✔
70
  tCleanupStreamHbMsg(&req, true);
50✔
71
  tFreeSMStreamHbRspMsg(&rsp);
50✔
72

73
  mstDebug("end to process stream hb req msg, code:%d", code);
50✔
74

75
  return code;
50✔
76
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc