• 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

74.34
/source/dnode/mgmt/mgmt_dnode/src/dmInt.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
#define _DEFAULT_SOURCE
17
#include "dmInt.h"
18
#include "libs/function/tudf.h"
19
#include "tanalytics.h"
20

21
static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) {
15✔
22
  int32_t code = 0;
15✔
23
  if ((code = dmStartStatusThread(pMgmt)) != 0) {
15!
24
    return code;
×
25
  }
26

27
  if ((code = dmStartConfigThread(pMgmt)) != 0) {
15!
28
    return code;
×
29
  }
30
  if ((code = dmStartStatusInfoThread(pMgmt)) != 0) {
15!
31
    return code;
×
32
  }
33
#if defined(TD_ENTERPRISE)
34
  if ((code = dmStartNotifyThread(pMgmt)) != 0) {
15!
35
    return code;
×
36
  }
37
#endif
38
  if ((code = dmStartMonitorThread(pMgmt)) != 0) {
15!
39
    return code;
×
40
  }
41
  if ((code = dmStartAuditThread(pMgmt)) != 0) {
15!
42
    return code;
×
43
  }
44
  if ((code = dmStartCrashReportThread(pMgmt)) != 0) {
15!
45
    return code;
×
46
  }
47
  if ((code = dmStartMetricsThread(pMgmt)) != 0) {
15!
48
    return code;
×
49
  }
50
  return 0;
15✔
51
}
52

53
static void dmStopMgmt(SDnodeMgmt *pMgmt) {
15✔
54
  pMgmt->pData->stopped = true;
15✔
55
  dmStopMonitorThread(pMgmt);
15✔
56
  dmStopAuditThread(pMgmt);
15✔
57
  dmStopStatusThread(pMgmt);
15✔
58
  dmStopConfigThread(pMgmt);
15✔
59
  dmStopStatusInfoThread(pMgmt);
15✔
60
#if defined(TD_ENTERPRISE)
61
  dmStopNotifyThread(pMgmt);
15✔
62
#endif
63
  dmStopCrashReportThread(pMgmt);
15✔
64
  dmStopMetricsThread(pMgmt);
15✔
65
}
15✔
66

67
static int32_t dmOpenMgmt(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
15✔
68
  int32_t     code = 0;
15✔
69
  SDnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SDnodeMgmt));
15!
70
  if (pMgmt == NULL) {
15!
71
    return terrno;
×
72
  }
73

74
  pMgmt->pData = pInput->pData;
15✔
75
  pMgmt->msgCb = pInput->msgCb;
15✔
76
  pMgmt->pTfs = pInput->pTfs;
15✔
77
  pMgmt->path = pInput->path;
15✔
78
  pMgmt->name = pInput->name;
15✔
79
  pMgmt->processCreateNodeFp = pInput->processCreateNodeFp;
15✔
80
  pMgmt->processAlterNodeFp = pInput->processAlterNodeFp;
15✔
81
  pMgmt->processAlterNodeTypeFp = pInput->processAlterNodeTypeFp;
15✔
82
  pMgmt->processDropNodeFp = pInput->processDropNodeFp;
15✔
83
  pMgmt->sendMonitorReportFp = pInput->sendMonitorReportFp;
15✔
84
  pMgmt->sendMetricsReportFp = pInput->sendMetricsReportFp;
15✔
85
  pMgmt->monitorCleanExpiredSamplesFp = pInput->monitorCleanExpiredSamplesFp;
15✔
86
  pMgmt->metricsCleanExpiredSamplesFp = pInput->metricsCleanExpiredSamplesFp;
15✔
87
  pMgmt->sendAuditRecordsFp = pInput->sendAuditRecordFp;
15✔
88
  pMgmt->getVnodeLoadsFp = pInput->getVnodeLoadsFp;
15✔
89
  pMgmt->getVnodeLoadsLiteFp = pInput->getVnodeLoadsLiteFp;
15✔
90
  pMgmt->getMnodeLoadsFp = pInput->getMnodeLoadsFp;
15✔
91
  pMgmt->getQnodeLoadsFp = pInput->getQnodeLoadsFp;
15✔
92

93
  if ((code = dmStartWorker(pMgmt)) != 0) {
15!
94
    return code;
×
95
  }
96

97
  if ((code = udfStartUdfd(pMgmt->pData->dnodeId)) != 0) {
15✔
98
    dError("failed to start taosudf since %s", tstrerror(code));
8!
99
  }
100

101
  if ((code = taosAnalyticsInit()) != 0) {
15!
102
    dError("failed to init analysis env since %s", tstrerror(code));
×
103
  }
104

105
  pOutput->pMgmt = pMgmt;
15✔
106
  return 0;
15✔
107
}
108

109
static void dmCloseMgmt(SDnodeMgmt *pMgmt) {
15✔
110
  dmStopWorker(pMgmt);
15✔
111
  taosMemoryFree(pMgmt);
15!
112
}
15✔
113

114
static int32_t dmRequireMgmt(const SMgmtInputOpt *pInput, bool *required) {
15✔
115
  *required = true;
15✔
116
  return 0;
15✔
117
}
118

119
SMgmtFunc dmGetMgmtFunc() {
15✔
120
  SMgmtFunc mgmtFunc = {0};
15✔
121
  mgmtFunc.openFp = dmOpenMgmt;
15✔
122
  mgmtFunc.closeFp = (NodeCloseFp)dmCloseMgmt;
15✔
123
  mgmtFunc.startFp = (NodeStartFp)dmStartMgmt;
15✔
124
  mgmtFunc.stopFp = (NodeStopFp)dmStopMgmt;
15✔
125
  mgmtFunc.requiredFp = dmRequireMgmt;
15✔
126
  mgmtFunc.getHandlesFp = dmGetMsgHandles;
15✔
127

128
  return mgmtFunc;
15✔
129
}
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