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

taosdata / TDengine / #5059

17 May 2026 01:15AM UTC coverage: 73.443% (+0.06%) from 73.387%
#5059

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)

281870 of 383795 relevant lines covered (73.44%)

135516561.93 hits per line

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

82.93
/source/libs/executor/src/querytask.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 "filter.h"
17
#include "function.h"
18
#include "functionMgt.h"
19
#include "os.h"
20
#include "querynodes.h"
21
#include "tfill.h"
22
#include "tname.h"
23

24
#include "tdatablock.h"
25
#include "tmsg.h"
26
#include "streamMsg.h"
27

28
#include "executorInt.h"
29
#include "index.h"
30
#include "operator.h"
31
#include "query.h"
32
#include "querytask.h"
33
#include "storageapi.h"
34
#include "thash.h"
35
#include "ttypes.h"
36
#include "tref.h"
37

38
#define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st)))
39

40
int32_t doCreateTask(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC_MODEL model, SStorageAPI* pAPI,
401,607,060✔
41
                     SExecTaskInfo** pTaskInfo) {
42
  if (pTaskInfo == NULL) {
401,607,060✔
43
    return TSDB_CODE_SUCCESS;
×
44
  }
45

46
  SExecTaskInfo* p = taosMemoryCalloc(1, sizeof(SExecTaskInfo));
401,607,060✔
47
  if (p == NULL) {
401,549,625✔
48
    return terrno;
×
49
  }
50

51
  setTaskStatus(p, TASK_NOT_COMPLETED);
401,549,625✔
52
  p->cost.created = taosGetTimestampUs();
401,624,131✔
53

54
  p->execModel = model;
401,614,520✔
55
  p->stopInfo.pStopInfo = taosArrayInit(4, sizeof(SExchangeOpStopInfo));
401,623,543✔
56
  p->pResultBlockList = taosArrayInit(128, POINTER_BYTES);
401,571,549✔
57
  if (p->stopInfo.pStopInfo == NULL || p->pResultBlockList == NULL) {
401,551,061✔
58
    doDestroyTask(p);
×
59
    return terrno;
×
60
  }
61

62
  p->storageAPI = *pAPI;
401,587,113✔
63
  taosInitRWLatch(&p->lock);
401,609,280✔
64

65
  p->id.vgId = vgId;
401,580,393✔
66
  p->id.queryId = queryId;
401,566,594✔
67
  p->id.taskId = taskId;
401,596,592✔
68
  p->id.str = taosMemoryMalloc(64);
401,584,275✔
69
  if (p->id.str == NULL) {
401,515,645✔
70
    doDestroyTask(p);
×
71
    return terrno;
×
72
  }
73

74
  buildTaskId(taskId, queryId, p->id.str, 64);
401,548,896✔
75
  p->schemaInfos = taosArrayInit(1, sizeof(SSchemaInfo));
401,551,951✔
76
  if (p->id.str == NULL || p->schemaInfos == NULL) {
401,476,713✔
77
    doDestroyTask(p);
×
78
    return terrno;
×
79
  }
80

81
  *pTaskInfo = p;
401,547,038✔
82
  return TSDB_CODE_SUCCESS;
401,543,350✔
83
}
84

85
int32_t getTaskCode(void* pTaskInfo) { return ((SExecTaskInfo*)pTaskInfo)->code; }
24,360✔
86

87
bool isTaskKilled(void* pTaskInfo) { return (0 != ((SExecTaskInfo*)pTaskInfo)->code); }
2,147,483,647✔
88

89
void setTaskKilled(SExecTaskInfo* pTaskInfo, int32_t rspCode) {
98,144✔
90
  pTaskInfo->code = rspCode;
98,144✔
91
  (void)stopTableScanOperator(pTaskInfo->pRoot, pTaskInfo->id.str, &pTaskInfo->storageAPI);
98,144✔
92
}
98,144✔
93

94
void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) {
1,365,712,649✔
95
  if (status == TASK_NOT_COMPLETED) {
1,365,712,649✔
96
    pTaskInfo->status = status;
401,772,275✔
97
  } else {
98
    // QUERY_NOT_COMPLETED is not compatible with any other status, so clear its position first
99
    CLEAR_QUERY_STATUS(pTaskInfo, TASK_NOT_COMPLETED);
963,940,374✔
100
    pTaskInfo->status |= status;
963,974,385✔
101
  }
102
}
1,365,762,448✔
103

104

105
int32_t initTaskSubJobCtx(SExecTaskInfo* pTaskInfo, SArray** subEndPoints, SReadHandle* readHandle) {
45,280,939✔
106
  int32_t code = 0, lino = 0;
45,280,939✔
107
  int32_t subJobNum = taosArrayGetSize(*subEndPoints);
45,280,939✔
108
  
109
  pTaskInfo->pSubJobCtx = taosMemoryCalloc(1, sizeof(*pTaskInfo->pSubJobCtx));
45,281,994✔
110
  TSDB_CHECK_NULL(pTaskInfo->pSubJobCtx, code, lino, _exit, terrno);
45,275,476✔
111
  
112
  STaskSubJobCtx* ctx = pTaskInfo->pSubJobCtx;
45,269,422✔
113

114
  ctx->queryId = pTaskInfo->id.queryId;
45,280,348✔
115
  ctx->taskId = pTaskInfo->id.taskId;
45,281,548✔
116
  ctx->idStr = pTaskInfo->id.str;
45,274,276✔
117
  ctx->pTaskInfo = pTaskInfo;
45,278,949✔
118
  ctx->subEndPoints = *subEndPoints;
45,276,676✔
119
  ctx->rpcHandle = (readHandle && readHandle->pMsgCb) ? readHandle->pMsgCb->clientRpc : NULL;
45,279,121✔
120
  ctx->isStream = pTaskInfo && IS_STREAM_MODE(pTaskInfo);
45,284,421✔
121

122
  *subEndPoints = NULL;
45,284,421✔
123
  
124
  ctx->subResNodes = taosArrayInit_s(POINTER_BYTES, subJobNum);
45,283,812✔
125
  if (NULL == ctx->subResNodes) {
45,275,922✔
126
    qError("%s taosArrayInit_s %d subResNodes failed, error:%s", GET_TASKID(pTaskInfo), subJobNum, tstrerror(terrno));
×
127
    TSDB_CHECK_NULL(ctx->subResNodes, code, lino, _exit, terrno);
×
128
  }
129
  
130
  TAOS_CHECK_EXIT(tsem_init(&ctx->ready, 0, 0));
45,277,749✔
131

132
  int64_t refId = taosAddRef(fetchObjRefPool, ctx);
45,281,412✔
133
  if (refId < 0) {
45,278,955✔
134
    qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
×
135
    TAOS_CHECK_EXIT(terrno);
×
136
  }
137
  
138
  ctx->subJobRefId = refId;
45,278,955✔
139

140
  qDebug("%s subJobCtx %" PRIu64 " with %d endPoints inited", pTaskInfo->id.str, (uint64_t)refId, (int32_t)taosArrayGetSize(ctx->subEndPoints));
45,273,519✔
141

142
_exit:
44,049,533✔
143

144
  if (code) {
45,274,122✔
145
    destroySubJobCtx(pTaskInfo->pSubJobCtx);
×
146
    pTaskInfo->pSubJobCtx = NULL;
×
147
    
148
    qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
×
149
  }
150

151
  return code;
45,278,976✔
152
}
153

154

155

156
int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
401,454,230✔
157
                           int32_t vgId, char* sql, EOPTR_EXEC_MODEL model, SArray** subEndPoints, bool enableExplain) {
158
  int32_t code = doCreateTask(pPlan->id.queryId, taskId, vgId, model, &pHandle->api, pTaskInfo);
401,454,230✔
159
  if (*pTaskInfo == NULL || code != 0) {
401,367,933✔
160
    nodesDestroyNode((SNode*)pPlan);
99✔
161
    return code;
×
162
  }
163

164
  (*pTaskInfo)->pSubplan = pPlan;
401,391,577✔
165

166
  if (NULL != sql) {
401,407,002✔
167
    (*pTaskInfo)->sql = taosStrdup(sql);
373,944,603✔
168
    if (NULL == (*pTaskInfo)->sql) {
373,928,895✔
169
      code = terrno;
×
170
      doDestroyTask(*pTaskInfo);
×
171
      (*pTaskInfo) = NULL;
×
172
      return code;
×
173
    }
174
  }
175

176
  (*pTaskInfo)->pWorkerCb = pHandle->pWorkerCb;
401,380,847✔
177
  (*pTaskInfo)->pStreamRuntimeInfo = pHandle->streamRtInfo;
401,407,203✔
178
  (*pTaskInfo)->enableExplain = enableExplain;
401,398,857✔
179

180
  if (subEndPoints && taosArrayGetSize(*subEndPoints) > 0) {
401,395,858✔
181
    code = initTaskSubJobCtx(*pTaskInfo, subEndPoints, pHandle);
45,279,576✔
182
    if (code != TSDB_CODE_SUCCESS) {
45,280,785✔
183
      doDestroyTask(*pTaskInfo);
×
184
      (*pTaskInfo) = NULL;
×
185
      return code;
×
186
    }
187
  }
188
  
189
  setTaskScalarExtraInfo(*pTaskInfo);
401,358,892✔
190
  
191
  code = createOperator(pPlan->pNode, *pTaskInfo, pHandle, pPlan->pTagCond, pPlan->pTagIndexCond, pPlan->user,
401,269,809✔
192
                        pPlan->dbFName, &((*pTaskInfo)->pRoot), model);
401,122,666✔
193

194
  if (NULL == (*pTaskInfo)->pRoot || code != 0) {
401,132,630✔
195
    doDestroyTask(*pTaskInfo);
511,604✔
196
    (*pTaskInfo) = NULL;
521,746✔
197
  }
198
  return code;
401,219,167✔
199
}
200

201
void cleanupQueriedTableScanInfo(void* p) {
295,185,396✔
202
  SSchemaInfo* pSchemaInfo = p;
295,185,396✔
203

204
  taosMemoryFreeClear(pSchemaInfo->dbname);
295,185,396✔
205
  taosMemoryFreeClear(pSchemaInfo->tablename);
295,140,970✔
206
  tDeleteSchemaWrapper(pSchemaInfo->sw);
295,078,507✔
207
  tDeleteSchemaWrapper(pSchemaInfo->qsw);
295,113,404✔
208
}
295,100,370✔
209

210
int32_t initQueriedTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode, const char* dbName,
295,244,916✔
211
                                   SExecTaskInfo* pTaskInfo) {
212
  SMetaReader mr = {0};
295,244,916✔
213
  if (pHandle == NULL) {
295,252,341✔
214
    return TSDB_CODE_INVALID_PARA;
×
215
  }
216

217
  SStorageAPI* pAPI = &pTaskInfo->storageAPI;
295,252,341✔
218

219
  pAPI->metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pAPI->metaFn);
295,239,198✔
220
  int32_t code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, pScanNode->uid);
295,250,808✔
221
  if (code != TSDB_CODE_SUCCESS) {
295,020,236✔
222
    qError("failed to get the table meta, uid:0x%" PRIx64 ", suid:0x%" PRIx64 ", %s", pScanNode->uid, pScanNode->suid,
552✔
223
           GET_TASKID(pTaskInfo));
224

225
    pAPI->metaReaderFn.clearReader(&mr);
552✔
226
    return code;
552✔
227
  }
228

229
  SSchemaInfo schemaInfo = {0};
295,019,684✔
230

231
  schemaInfo.tablename = taosStrdup(mr.me.name);
295,015,113✔
232
  schemaInfo.dbname = taosStrdup(dbName);
294,995,150✔
233
  if (schemaInfo.tablename == NULL || schemaInfo.dbname == NULL) {
295,096,600✔
234
    pAPI->metaReaderFn.clearReader(&mr);
228,765✔
235
    cleanupQueriedTableScanInfo(&schemaInfo);
×
236
    return terrno;
×
237
  }
238

239
  if (mr.me.type == TSDB_VIRTUAL_NORMAL_TABLE || mr.me.type == TSDB_VIRTUAL_CHILD_TABLE) {
294,867,835✔
240
    schemaInfo.rversion = mr.me.colRef.version;
324,508✔
241
  }
242

243
  if (mr.me.type == TSDB_SUPER_TABLE) {
294,867,835✔
244
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.stbEntry.schemaRow);
129,488,975✔
245
    schemaInfo.tversion = mr.me.stbEntry.schemaTag.version;
129,488,975✔
246
  } else if (mr.me.type == TSDB_CHILD_TABLE || mr.me.type == TSDB_VIRTUAL_CHILD_TABLE) {
165,472,357✔
247
    tDecoderClear(&mr.coder);
116,485,062✔
248

249
    tb_uid_t suid = mr.me.ctbEntry.suid;
116,604,023✔
250
    code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, suid);
116,604,023✔
251
    if (code != TSDB_CODE_SUCCESS) {
116,601,814✔
252
      pAPI->metaReaderFn.clearReader(&mr);
×
253
      cleanupQueriedTableScanInfo(&schemaInfo);
×
254
      return code;
×
255
    }
256

257
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.stbEntry.schemaRow);
116,602,310✔
258
    schemaInfo.tversion = mr.me.stbEntry.schemaTag.version;
116,602,310✔
259
  } else {
260
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.ntbEntry.schemaRow);
48,985,631✔
261
  }
262

263
  pAPI->metaReaderFn.clearReader(&mr);
295,076,916✔
264

265
  if (schemaInfo.sw == NULL) {
294,873,791✔
266
    cleanupQueriedTableScanInfo(&schemaInfo);
×
267
    return terrno;
×
268
  }
269

270
  schemaInfo.qsw = extractQueriedColumnSchema(pScanNode);
294,873,791✔
271
  if (schemaInfo.qsw == NULL) {
294,984,090✔
272
    cleanupQueriedTableScanInfo(&schemaInfo);
×
273
    return terrno;
×
274
  }
275

276
  void* p = taosArrayPush(pTaskInfo->schemaInfos, &schemaInfo);
294,984,090✔
277
  if (p == NULL) {
295,129,705✔
278
    cleanupQueriedTableScanInfo(&schemaInfo);
×
279
    return terrno;
×
280
  }
281

282
  return code;
295,129,705✔
283
}
284

285
SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode) {
294,954,928✔
286
  int32_t numOfCols = LIST_LENGTH(pScanNode->pScanCols);
294,954,928✔
287
  int32_t numOfTags = LIST_LENGTH(pScanNode->pScanPseudoCols);
295,133,745✔
288

289
  SSchemaWrapper* pqSw = taosMemoryCalloc(1, sizeof(SSchemaWrapper));
295,061,209✔
290
  if (pqSw == NULL) {
294,833,546✔
291
    return NULL;
×
292
  }
293

294
  pqSw->pSchema = taosMemoryCalloc(numOfCols + numOfTags, sizeof(SSchema));
294,833,546✔
295
  if (pqSw->pSchema == NULL) {
294,657,360✔
296
    taosMemoryFree(pqSw);
×
297
    return NULL;
×
298
  }
299

300
  for (int32_t i = 0; i < numOfCols; ++i) {
1,322,503,175✔
301
    STargetNode* pNode = (STargetNode*)nodesListGetNode(pScanNode->pScanCols, i);
1,027,340,900✔
302
    SColumnNode* pColNode = (SColumnNode*)pNode->pExpr;
1,027,194,200✔
303

304
    SSchema* pSchema = &pqSw->pSchema[pqSw->nCols++];
1,027,306,717✔
305
    pSchema->colId = pColNode->colId;
1,027,323,539✔
306
    pSchema->type = pColNode->node.resType.type;
1,027,535,451✔
307
    pSchema->bytes = pColNode->node.resType.bytes;
1,027,435,451✔
308
    tstrncpy(pSchema->name, pColNode->colName, tListLen(pSchema->name));
1,027,612,575✔
309
  }
310

311
  // this the tags and pseudo function columns, we only keep the tag columns
312
  for (int32_t i = 0; i < numOfTags; ++i) {
487,381,753✔
313
    STargetNode* pNode = (STargetNode*)nodesListGetNode(pScanNode->pScanPseudoCols, i);
192,226,699✔
314

315
    int32_t type = nodeType(pNode->pExpr);
192,165,403✔
316
    if (type == QUERY_NODE_COLUMN) {
192,196,388✔
317
      SColumnNode* pColNode = (SColumnNode*)pNode->pExpr;
146,391,150✔
318

319
      SSchema* pSchema = &pqSw->pSchema[pqSw->nCols++];
146,399,658✔
320
      pSchema->colId = pColNode->colId;
146,455,864✔
321
      pSchema->type = pColNode->node.resType.type;
146,351,869✔
322
      pSchema->bytes = pColNode->node.resType.bytes;
146,398,878✔
323
      tstrncpy(pSchema->name, pColNode->colName, tListLen(pSchema->name));
146,383,660✔
324
    }
325
  }
326

327
  return pqSw;
295,155,054✔
328
}
329

330
static void cleanupTmqInfo(STmqTaskInfo* pTmqInfo) {
401,473,187✔
331
  tDeleteSchemaWrapper(pTmqInfo->schema);
401,473,187✔
332
  tOffsetDestroy(&pTmqInfo->currentOffset);
401,526,892✔
333
}
401,378,090✔
334

335
static void freeBlock(void* pParam) {
764,737,919✔
336
  SSDataBlock* pBlock = *(SSDataBlock**)pParam;
764,737,919✔
337
  blockDataDestroy(pBlock);
764,753,461✔
338
}
764,741,983✔
339

340

341
void destroySubJobCtx(STaskSubJobCtx* pCtx) {
45,280,158✔
342
  if (pCtx->transporterId > 0) {
45,280,158✔
343
    int32_t ret = asyncFreeConnById(pCtx->rpcHandle, pCtx->transporterId);
9,744✔
344
    if (ret != 0) {
9,744✔
345
      qDebug("%s failed to free subQ rpc handle, code:%s", pCtx->idStr, tstrerror(ret));
×
346
    }
347
    pCtx->transporterId = -1;
9,744✔
348
  }
349

350
  if (pCtx->subEndPoints != NULL) {
45,282,594✔
351
    size_t size = taosArrayGetSize(pCtx->subEndPoints);
45,281,376✔
352
    if (size > 0) {
45,280,176✔
353
      int32_t code = tsem_destroy(&pCtx->ready);
45,281,394✔
354
      if (code != TSDB_CODE_SUCCESS) {
45,283,821✔
355
        qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
×
356
      }
357
      taosArrayDestroy(pCtx->subResNodes);
45,283,821✔
358
    }
359
    if (pCtx->isStream) {
45,274,086✔
360
      taosArrayDestroyP(pCtx->subEndPoints, (FDelete)nodesDestroyNode);
274,300✔
361
    } else {
362
      taosArrayDestroyP(pCtx->subEndPoints, NULL);
45,001,613✔
363
    }
364
    pCtx->subEndPoints = NULL;
45,275,919✔
365
  }
366
  
367
  taosMemoryFreeClear(pCtx);  
45,277,137✔
368
}
45,274,719✔
369

370
void doDestroyTask(SExecTaskInfo* pTaskInfo) {
401,615,452✔
371
  qDebug("%s execTask is freed", GET_TASKID(pTaskInfo));
401,615,452✔
372
  destroyOperator(pTaskInfo->pRoot);
401,614,809✔
373
  pTaskInfo->pRoot = NULL;
401,479,138✔
374

375
  if (pTaskInfo->pSubJobCtx) {
401,503,905✔
376
    int32_t  code = taosRemoveRef(fetchObjRefPool, pTaskInfo->pSubJobCtx->subJobRefId);
45,279,558✔
377
    if (code != TSDB_CODE_SUCCESS) {
45,282,012✔
378
      qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
×
379
    }
380
  }
381

382
  taosArrayDestroyEx(pTaskInfo->schemaInfos, cleanupQueriedTableScanInfo);
401,553,129✔
383
  cleanupTmqInfo(&pTaskInfo->tmqInfo);
401,463,589✔
384

385
  if (!pTaskInfo->localFetch.localExec) {
401,375,731✔
386
    nodesDestroyNode((SNode*)pTaskInfo->pSubplan);
401,420,331✔
387
    pTaskInfo->pSubplan = NULL;
401,505,134✔
388
  }
389

390
  taosArrayDestroyEx(pTaskInfo->pResultBlockList, freeBlock);
401,504,818✔
391
  taosArrayDestroy(pTaskInfo->stopInfo.pStopInfo);
401,527,028✔
392
  if (!pTaskInfo->paramSet) {
401,536,822✔
393
    freeOperatorParam(pTaskInfo->pOpParam, OP_GET_PARAM);
392,940,621✔
394
    pTaskInfo->pOpParam = NULL;
392,850,698✔
395
  }
396
  if (pTaskInfo->ownStreamRtInfo && pTaskInfo->pStreamRuntimeInfo != NULL) {
401,439,055✔
397
    SStreamRuntimeFuncInfo* pRt = &pTaskInfo->pStreamRuntimeInfo->funcInfo;
565,748✔
398

399
    // When isMultiGroupCalc, pStreamPesudoFuncVals is aliased to curGrpCalc->pParams
400
    // inside pGroupCalcInfos.  NULL it out so tDestroyStRtFuncInfo won't free it twice.
401
    if (pRt->isMultiGroupCalc && pRt->pGroupCalcInfos != NULL) {
565,302✔
402
      pRt->pStreamPesudoFuncVals = NULL;
77,604✔
403
      pRt->pStreamPartColVals = NULL;
77,604✔
404
    }
405
    tDestroyStRtFuncInfo(pRt);
565,302✔
406
    taosMemoryFreeClear(pTaskInfo->pStreamRuntimeInfo);
565,748✔
407
  }
408
  taosMemoryFreeClear(pTaskInfo->sql);
401,535,233✔
409
  taosMemoryFreeClear(pTaskInfo->id.str);
401,518,036✔
410
  taosMemoryFreeClear(pTaskInfo);
401,426,072✔
411
}
401,381,542✔
412

413
void buildTaskId(uint64_t taskId, uint64_t queryId, char* dst, int32_t len) {
586,281,290✔
414
  int32_t ret = snprintf(dst, len, "TID:0x%" PRIx64 " QID:0x%" PRIx64, taskId, queryId);
586,281,290✔
415
  if (ret < 0) {
586,281,290✔
416
    qError("TID:0x%"PRIx64" QID:0x%"PRIx64" create task id failed,  ignore and continue", taskId, queryId);
×
417
  }
418
}
586,281,290✔
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