• 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

0.0
/source/util/src/tthread.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 "tthread.h"
18

19
TdThread* taosCreateThread(void* (*__start_routine)(void*), void* param) {
×
20
  TdThread* pthread = (TdThread*)taosMemoryMalloc(sizeof(TdThread));
×
21
  if (pthread == NULL) {
×
22
    terrno = TSDB_CODE_OUT_OF_MEMORY;
×
23
    return NULL;
×
24
  }
25

26
  TdThreadAttr thattr;
×
27
  (void)taosThreadAttrInit(&thattr);
×
28
  (void)taosThreadAttrSetDetachState(&thattr, PTHREAD_CREATE_JOINABLE);
×
29
  int32_t ret = taosThreadCreate(pthread, &thattr, __start_routine, param);
×
30
  (void)taosThreadAttrDestroy(&thattr);
×
31

32
  if (ret != 0) {
×
33
    taosMemoryFree(pthread);
×
34
    terrno = TAOS_SYSTEM_ERROR(ret);
×
35
    return NULL;
×
36
  }
37
  return pthread;
×
38
}
39

40
bool taosDestroyThread(TdThread* pthread) {
×
41
  if (pthread == NULL) return false;
×
42
  if (taosThreadRunning(pthread)) {
×
43
    (void)taosThreadCancel(*pthread);
×
44
    (void)taosThreadJoin(*pthread, NULL);
×
45
  }
46

47
  taosMemoryFree(pthread);
×
48
  return true;
×
49
}
50

51
bool taosThreadRunning(TdThread* pthread) {
×
52
  if (pthread == NULL) return false;
×
53
  int32_t ret = taosThreadKill(*pthread, 0);
×
54
  if (ret == ESRCH) return false;
×
55
  if (ret == EINVAL) return false;
×
56
  // alive
57
  return true;
×
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc