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

taosdata / TDengine / #5071

17 May 2026 01:15AM UTC coverage: 63.054% (-10.3%) from 73.326%
#5071

push

travis-ci

web-flow
feat (TDgpt): Dynamic Model Synchronization Enhancements (#35344)

* refactor: do some internal refactor.

* fix: fix multiprocess sync issue.

* feat: add dynamic anomaly detection and forecasting services

* fix: log error message for undeploying model in exception handling

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: handle undeploy when model exists only on disk

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/286aafa0-c3ce-4c27-b803-2707571e9dc1

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: guard dynamic registry concurrent access

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/5e4db858-6458-40f4-ac28-d1b1b7f97c18

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: tighten service list locking scope

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/5e4db858-6458-40f4-ac28-d1b1b7f97c18

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: restore prophet support and update tests per review feedback

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/92298ae1-7da6-4d07-b20e-101c7cd0b26b

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: improve test name and move copy inside lock scope

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/92298ae1-7da6-4d07-b20e-101c7cd0b26b

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* Potential fix for pull request finding

Co-au... (continued)

238317 of 377957 relevant lines covered (63.05%)

130539817.12 hits per line

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

36.11
/source/dnode/xnode/src/xnode.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 "libs/txnode/txnode.h"
17
#include "xndInt.h"
18

19
static SXnode xnodeInstance = {0};
20
SXnode       *xndInstance() { return &xnodeInstance; }
×
21

22
int32_t xndOpen(const SXnodeOpt *pOption, SXnode **pXnode) {
535,520✔
23
  *pXnode = &xnodeInstance;
535,520✔
24
  (*pXnode)->protocol = (int8_t)pOption->proto;
535,520✔
25
  (*pXnode)->dnodeId = pOption->dnodeId;
535,520✔
26
  (*pXnode)->clusterId = pOption->clusterId;
535,520✔
27
  (*pXnode)->ep = pOption->ep;
535,520✔
28

29
  // if (TSDB_XNODE_OPT_PROTO == (*pXnode)->protocol) {
30
  //   // if ((code = xnodeMgmtStartXnoded((*pXnode)->dnodeId)) != 0) {
31
  //   if ((code = xnodeMgmtStartXnoded(*pXnode)) != 0) {
32
  //     xndError("failed to start xnoded since %s", tstrerror(code));
33

34
  //     taosMemoryFree(*pXnode);
35
  //     TAOS_RETURN(code);
36
  //   }
37
  // } else {
38
  //   xndError("Unknown xnode proto: %hhd.", (*pXnode)->protocol);
39

40
  //   taosMemoryFree(*pXnode);
41
  //   TAOS_RETURN(code);
42
  // }
43

44
  xndInfo("xnode: opened & initialized by dnode");
535,520✔
45

46
  return TSDB_CODE_SUCCESS;
535,520✔
47
}
48

49
void xndClose(SXnode *pXnode) {
535,520✔
50
  xndInfo("xnode: dnode is closing xnoded");
535,520✔
51
  xnodeMgmtStopXnoded();
535,520✔
52
}
535,520✔
53

54
int32_t mndOpenXnd(const SXnodeOpt *pOption) {
×
55
  int32_t code = 0;
×
56
  SXnode *pXnode = xndInstance();
×
57
  pXnode->dnodeId = pOption->dnodeId;
×
58
  pXnode->clusterId = pOption->clusterId;
×
59
  pXnode->upLen = pOption->upLen;
×
60
  pXnode->ep = pOption->ep;
×
61
  memset(pXnode->userPass, 0, XNODE_USER_PASS_LEN);
×
62
  memcpy(pXnode->userPass, pOption->userPass, pOption->upLen);
×
63
  memset(pXnode->token, 0, sizeof(pXnode->token));
×
64
  memcpy(pXnode->token, pOption->token, TSDB_TOKEN_LEN);
×
65

66
  if ((code = xnodeMgmtStartXnoded(pXnode)) != 0) {
×
67
    xndError("failed to start xnoded since %s", tstrerror(code));
×
68

69
    TAOS_RETURN(code);
×
70
  }
71
  return code;
×
72
}
73

74
void mndCloseXnd() { xnodeMgmtStopXnoded(); }
15,592✔
75

76
void getXnodedPipeName(char *pipeName, int32_t size) {
×
77
  int32_t len = strlen(tsDataDir);
×
78
  if (len > 0 && (tsDataDir[len - 1] != '/' && tsDataDir[len - 1] != '\\')) {
×
79
  #ifdef _WIN32
80
    snprintf(pipeName, size, "%s\\.%s.%x", tsDataDir, XNODED_MGMT_LISTEN_PIPE_NAME_PREFIX, MurmurHash3_32(tsDataDir, strlen(tsDataDir)));
81
  #else
82
    snprintf(pipeName, size, "%s/%s", tsDataDir, XNODED_MGMT_LISTEN_PIPE_NAME_PREFIX);
×
83
  #endif
84
  } else {
85
  #ifdef _WIN32
86
    snprintf(pipeName, size, "%s.%s.%x", tsDataDir, XNODED_MGMT_LISTEN_PIPE_NAME_PREFIX, MurmurHash3_32(tsDataDir, strlen(tsDataDir)));
87
  #else
88
    snprintf(pipeName, size, "%s%s", tsDataDir, XNODED_MGMT_LISTEN_PIPE_NAME_PREFIX);
×
89
  #endif
90
  }
91
  xndDebug("xnode get unix socket pipe path:%s", pipeName);
×
92
}
×
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