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

taosdata / TDengine / #5081

17 May 2026 01:15AM UTC coverage: 73.368% (-0.04%) from 73.403%
#5081

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)

281582 of 383795 relevant lines covered (73.37%)

137177705.18 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,
411,165,150✔
41
                     SExecTaskInfo** pTaskInfo) {
42
  if (pTaskInfo == NULL) {
411,165,150✔
43
    return TSDB_CODE_SUCCESS;
×
44
  }
45

46
  SExecTaskInfo* p = taosMemoryCalloc(1, sizeof(SExecTaskInfo));
411,165,150✔
47
  if (p == NULL) {
411,163,185✔
48
    return terrno;
×
49
  }
50

51
  setTaskStatus(p, TASK_NOT_COMPLETED);
411,163,185✔
52
  p->cost.created = taosGetTimestampUs();
411,172,546✔
53

54
  p->execModel = model;
411,148,789✔
55
  p->stopInfo.pStopInfo = taosArrayInit(4, sizeof(SExchangeOpStopInfo));
411,151,021✔
56
  p->pResultBlockList = taosArrayInit(128, POINTER_BYTES);
411,145,943✔
57
  if (p->stopInfo.pStopInfo == NULL || p->pResultBlockList == NULL) {
411,120,894✔
58
    doDestroyTask(p);
450✔
59
    return terrno;
×
60
  }
61

62
  p->storageAPI = *pAPI;
411,136,117✔
63
  taosInitRWLatch(&p->lock);
411,146,597✔
64

65
  p->id.vgId = vgId;
411,120,051✔
66
  p->id.queryId = queryId;
411,126,557✔
67
  p->id.taskId = taskId;
411,128,667✔
68
  p->id.str = taosMemoryMalloc(64);
411,135,383✔
69
  if (p->id.str == NULL) {
411,076,813✔
70
    doDestroyTask(p);
×
71
    return terrno;
×
72
  }
73

74
  buildTaskId(taskId, queryId, p->id.str, 64);
411,115,404✔
75
  p->schemaInfos = taosArrayInit(1, sizeof(SSchemaInfo));
411,118,208✔
76
  if (p->id.str == NULL || p->schemaInfos == NULL) {
411,053,944✔
77
    doDestroyTask(p);
×
78
    return terrno;
×
79
  }
80

81
  *pTaskInfo = p;
411,099,777✔
82
  return TSDB_CODE_SUCCESS;
411,065,514✔
83
}
84

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

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

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

94
void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) {
1,402,008,402✔
95
  if (status == TASK_NOT_COMPLETED) {
1,402,008,402✔
96
    pTaskInfo->status = status;
411,375,685✔
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);
990,632,717✔
100
    pTaskInfo->status |= status;
990,649,865✔
101
  }
102
}
1,402,016,375✔
103

104

105
int32_t initTaskSubJobCtx(SExecTaskInfo* pTaskInfo, SArray** subEndPoints, SReadHandle* readHandle) {
45,240,833✔
106
  int32_t code = 0, lino = 0;
45,240,833✔
107
  int32_t subJobNum = taosArrayGetSize(*subEndPoints);
45,240,833✔
108
  
109
  pTaskInfo->pSubJobCtx = taosMemoryCalloc(1, sizeof(*pTaskInfo->pSubJobCtx));
45,235,985✔
110
  TSDB_CHECK_NULL(pTaskInfo->pSubJobCtx, code, lino, _exit, terrno);
45,228,708✔
111
  
112
  STaskSubJobCtx* ctx = pTaskInfo->pSubJobCtx;
45,223,866✔
113

114
  ctx->queryId = pTaskInfo->id.queryId;
45,235,986✔
115
  ctx->taskId = pTaskInfo->id.taskId;
45,237,798✔
116
  ctx->idStr = pTaskInfo->id.str;
45,238,404✔
117
  ctx->pTaskInfo = pTaskInfo;
45,237,798✔
118
  ctx->subEndPoints = *subEndPoints;
45,232,950✔
119
  ctx->rpcHandle = (readHandle && readHandle->pMsgCb) ? readHandle->pMsgCb->clientRpc : NULL;
45,224,477✔
120
  ctx->isStream = pTaskInfo && IS_STREAM_MODE(pTaskInfo);
45,242,634✔
121

122
  *subEndPoints = NULL;
45,235,368✔
123
  
124
  ctx->subResNodes = taosArrayInit_s(POINTER_BYTES, subJobNum);
45,233,721✔
125
  if (NULL == ctx->subResNodes) {
45,231,737✔
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,227,659✔
131

132
  int64_t refId = taosAddRef(fetchObjRefPool, ctx);
45,231,302✔
133
  if (refId < 0) {
45,240,210✔
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,240,210✔
139

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

142
_exit:
44,058,254✔
143

144
  if (code) {
45,234,162✔
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,231,148✔
152
}
153

154

155

156
int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
411,013,013✔
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);
411,013,013✔
159
  if (*pTaskInfo == NULL || code != 0) {
410,926,333✔
160
    nodesDestroyNode((SNode*)pPlan);
×
161
    return code;
×
162
  }
163

164
  (*pTaskInfo)->pSubplan = pPlan;
410,944,030✔
165

166
  if (NULL != sql) {
410,922,197✔
167
    (*pTaskInfo)->sql = taosStrdup(sql);
383,499,783✔
168
    if (NULL == (*pTaskInfo)->sql) {
383,503,432✔
169
      code = terrno;
×
170
      doDestroyTask(*pTaskInfo);
×
171
      (*pTaskInfo) = NULL;
×
172
      return code;
×
173
    }
174
  }
175

176
  (*pTaskInfo)->pWorkerCb = pHandle->pWorkerCb;
410,930,776✔
177
  (*pTaskInfo)->pStreamRuntimeInfo = pHandle->streamRtInfo;
410,933,526✔
178
  (*pTaskInfo)->enableExplain = enableExplain;
410,928,354✔
179

180
  if (subEndPoints && taosArrayGetSize(*subEndPoints) > 0) {
410,908,736✔
181
    code = initTaskSubJobCtx(*pTaskInfo, subEndPoints, pHandle);
45,243,250✔
182
    if (code != TSDB_CODE_SUCCESS) {
45,232,955✔
183
      doDestroyTask(*pTaskInfo);
×
184
      (*pTaskInfo) = NULL;
×
185
      return code;
×
186
    }
187
  }
188
  
189
  setTaskScalarExtraInfo(*pTaskInfo);
410,952,815✔
190
  
191
  code = createOperator(pPlan->pNode, *pTaskInfo, pHandle, pPlan->pTagCond, pPlan->pTagIndexCond, pPlan->user,
410,790,177✔
192
                        pPlan->dbFName, &((*pTaskInfo)->pRoot), model);
410,678,412✔
193

194
  if (NULL == (*pTaskInfo)->pRoot || code != 0) {
410,680,618✔
195
    doDestroyTask(*pTaskInfo);
777,015✔
196
    (*pTaskInfo) = NULL;
517,250✔
197
  }
198
  return code;
410,482,330✔
199
}
200

201
void cleanupQueriedTableScanInfo(void* p) {
297,822,897✔
202
  SSchemaInfo* pSchemaInfo = p;
297,822,897✔
203

204
  taosMemoryFreeClear(pSchemaInfo->dbname);
297,822,897✔
205
  taosMemoryFreeClear(pSchemaInfo->tablename);
297,796,669✔
206
  tDeleteSchemaWrapper(pSchemaInfo->sw);
297,764,470✔
207
  tDeleteSchemaWrapper(pSchemaInfo->qsw);
297,794,637✔
208
}
297,782,253✔
209

210
int32_t initQueriedTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode, const char* dbName,
297,881,282✔
211
                                   SExecTaskInfo* pTaskInfo) {
212
  SMetaReader mr = {0};
297,881,282✔
213
  if (pHandle == NULL) {
297,887,684✔
214
    return TSDB_CODE_INVALID_PARA;
×
215
  }
216

217
  SStorageAPI* pAPI = &pTaskInfo->storageAPI;
297,887,684✔
218

219
  pAPI->metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pAPI->metaFn);
297,887,577✔
220
  int32_t code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, pScanNode->uid);
297,889,790✔
221
  if (code != TSDB_CODE_SUCCESS) {
297,693,647✔
222
    qError("failed to get the table meta, uid:0x%" PRIx64 ", suid:0x%" PRIx64 ", %s", pScanNode->uid, pScanNode->suid,
276✔
223
           GET_TASKID(pTaskInfo));
224

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

229
  SSchemaInfo schemaInfo = {0};
297,693,371✔
230

231
  schemaInfo.tablename = taosStrdup(mr.me.name);
297,632,709✔
232
  schemaInfo.dbname = taosStrdup(dbName);
297,685,020✔
233
  if (schemaInfo.tablename == NULL || schemaInfo.dbname == NULL) {
297,756,969✔
234
    pAPI->metaReaderFn.clearReader(&mr);
221,556✔
235
    cleanupQueriedTableScanInfo(&schemaInfo);
×
236
    return terrno;
×
237
  }
238

239
  if (mr.me.type == TSDB_VIRTUAL_NORMAL_TABLE || mr.me.type == TSDB_VIRTUAL_CHILD_TABLE) {
297,535,413✔
240
    schemaInfo.rversion = mr.me.colRef.version;
324,258✔
241
  }
242

243
  if (mr.me.type == TSDB_SUPER_TABLE) {
297,535,413✔
244
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.stbEntry.schemaRow);
132,027,337✔
245
    schemaInfo.tversion = mr.me.stbEntry.schemaTag.version;
132,027,337✔
246
  } else if (mr.me.type == TSDB_CHILD_TABLE || mr.me.type == TSDB_VIRTUAL_CHILD_TABLE) {
165,639,556✔
247
    tDecoderClear(&mr.coder);
116,629,458✔
248

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

257
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.stbEntry.schemaRow);
116,668,850✔
258
    schemaInfo.tversion = mr.me.stbEntry.schemaTag.version;
116,668,850✔
259
  } else {
260
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.ntbEntry.schemaRow);
49,018,504✔
261
  }
262

263
  pAPI->metaReaderFn.clearReader(&mr);
297,714,691✔
264

265
  if (schemaInfo.sw == NULL) {
297,615,000✔
266
    cleanupQueriedTableScanInfo(&schemaInfo);
×
267
    return terrno;
×
268
  }
269

270
  schemaInfo.qsw = extractQueriedColumnSchema(pScanNode);
297,615,000✔
271
  if (schemaInfo.qsw == NULL) {
297,625,468✔
272
    cleanupQueriedTableScanInfo(&schemaInfo);
×
273
    return terrno;
×
274
  }
275

276
  void* p = taosArrayPush(pTaskInfo->schemaInfos, &schemaInfo);
297,625,468✔
277
  if (p == NULL) {
297,779,737✔
278
    cleanupQueriedTableScanInfo(&schemaInfo);
×
279
    return terrno;
×
280
  }
281

282
  return code;
297,779,737✔
283
}
284

285
SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode) {
297,679,347✔
286
  int32_t numOfCols = LIST_LENGTH(pScanNode->pScanCols);
297,679,347✔
287
  int32_t numOfTags = LIST_LENGTH(pScanNode->pScanPseudoCols);
297,758,326✔
288

289
  SSchemaWrapper* pqSw = taosMemoryCalloc(1, sizeof(SSchemaWrapper));
297,636,372✔
290
  if (pqSw == NULL) {
297,496,875✔
291
    return NULL;
×
292
  }
293

294
  pqSw->pSchema = taosMemoryCalloc(numOfCols + numOfTags, sizeof(SSchema));
297,496,875✔
295
  if (pqSw->pSchema == NULL) {
297,330,207✔
296
    taosMemoryFree(pqSw);
×
297
    return NULL;
×
298
  }
299

300
  for (int32_t i = 0; i < numOfCols; ++i) {
1,328,611,526✔
301
    STargetNode* pNode = (STargetNode*)nodesListGetNode(pScanNode->pScanCols, i);
1,030,782,393✔
302
    SColumnNode* pColNode = (SColumnNode*)pNode->pExpr;
1,030,601,146✔
303

304
    SSchema* pSchema = &pqSw->pSchema[pqSw->nCols++];
1,030,667,993✔
305
    pSchema->colId = pColNode->colId;
1,030,741,403✔
306
    pSchema->type = pColNode->node.resType.type;
1,030,910,803✔
307
    pSchema->bytes = pColNode->node.resType.bytes;
1,030,852,463✔
308
    tstrncpy(pSchema->name, pColNode->colName, tListLen(pSchema->name));
1,030,841,278✔
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) {
473,700,821✔
313
    STargetNode* pNode = (STargetNode*)nodesListGetNode(pScanNode->pScanPseudoCols, i);
175,856,966✔
314

315
    int32_t type = nodeType(pNode->pExpr);
175,846,051✔
316
    if (type == QUERY_NODE_COLUMN) {
175,879,763✔
317
      SColumnNode* pColNode = (SColumnNode*)pNode->pExpr;
131,017,888✔
318

319
      SSchema* pSchema = &pqSw->pSchema[pqSw->nCols++];
131,016,921✔
320
      pSchema->colId = pColNode->colId;
131,013,203✔
321
      pSchema->type = pColNode->node.resType.type;
130,974,968✔
322
      pSchema->bytes = pColNode->node.resType.bytes;
130,927,167✔
323
      tstrncpy(pSchema->name, pColNode->colName, tListLen(pSchema->name));
130,959,428✔
324
    }
325
  }
326

327
  return pqSw;
297,843,855✔
328
}
329

330
static void cleanupTmqInfo(STmqTaskInfo* pTmqInfo) {
411,038,453✔
331
  tDeleteSchemaWrapper(pTmqInfo->schema);
411,038,453✔
332
  tOffsetDestroy(&pTmqInfo->currentOffset);
411,089,003✔
333
}
410,919,614✔
334

335
static void freeBlock(void* pParam) {
787,420,365✔
336
  SSDataBlock* pBlock = *(SSDataBlock**)pParam;
787,420,365✔
337
  blockDataDestroy(pBlock);
787,439,242✔
338
}
787,440,196✔
339

340

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

350
  if (pCtx->subEndPoints != NULL) {
45,242,028✔
351
    size_t size = taosArrayGetSize(pCtx->subEndPoints);
45,239,609✔
352
    if (size > 0) {
45,237,186✔
353
      int32_t code = tsem_destroy(&pCtx->ready);
45,239,610✔
354
      if (code != TSDB_CODE_SUCCESS) {
45,243,240✔
355
        qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
×
356
      }
357
      taosArrayDestroy(pCtx->subResNodes);
45,243,240✔
358
    }
359
    if (pCtx->isStream) {
45,229,918✔
360
      taosArrayDestroyP(pCtx->subEndPoints, (FDelete)nodesDestroyNode);
225,003✔
361
    } else {
362
      taosArrayDestroyP(pCtx->subEndPoints, NULL);
45,007,339✔
363
    }
364
    pCtx->subEndPoints = NULL;
45,236,574✔
365
  }
366
  
367
  taosMemoryFreeClear(pCtx);  
45,241,423✔
368
}
45,236,575✔
369

370
void doDestroyTask(SExecTaskInfo* pTaskInfo) {
411,174,303✔
371
  qDebug("%s execTask is freed", GET_TASKID(pTaskInfo));
411,174,303✔
372
  destroyOperator(pTaskInfo->pRoot);
411,174,422✔
373
  pTaskInfo->pRoot = NULL;
411,074,081✔
374

375
  if (pTaskInfo->pSubJobCtx) {
411,094,650✔
376
    int32_t  code = taosRemoveRef(fetchObjRefPool, pTaskInfo->pSubJobCtx->subJobRefId);
45,237,792✔
377
    if (code != TSDB_CODE_SUCCESS) {
45,243,240✔
378
      qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
×
379
    }
380
  }
381

382
  taosArrayDestroyEx(pTaskInfo->schemaInfos, cleanupQueriedTableScanInfo);
411,119,108✔
383
  cleanupTmqInfo(&pTaskInfo->tmqInfo);
411,022,352✔
384

385
  if (!pTaskInfo->localFetch.localExec) {
410,906,509✔
386
    nodesDestroyNode((SNode*)pTaskInfo->pSubplan);
410,954,106✔
387
    pTaskInfo->pSubplan = NULL;
411,095,044✔
388
  }
389

390
  taosArrayDestroyEx(pTaskInfo->pResultBlockList, freeBlock);
411,084,082✔
391
  taosArrayDestroy(pTaskInfo->stopInfo.pStopInfo);
411,105,454✔
392
  if (!pTaskInfo->paramSet) {
411,103,112✔
393
    freeOperatorParam(pTaskInfo->pOpParam, OP_GET_PARAM);
400,758,300✔
394
    pTaskInfo->pOpParam = NULL;
400,670,876✔
395
  }
396
  if (pTaskInfo->ownStreamRtInfo && pTaskInfo->pStreamRuntimeInfo != NULL) {
411,002,456✔
397
    SStreamRuntimeFuncInfo* pRt = &pTaskInfo->pStreamRuntimeInfo->funcInfo;
566,941✔
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) {
566,941✔
402
      pRt->pStreamPesudoFuncVals = NULL;
77,778✔
403
      pRt->pStreamPartColVals = NULL;
77,778✔
404
    }
405
    tDestroyStRtFuncInfo(pRt);
566,941✔
406
    taosMemoryFreeClear(pTaskInfo->pStreamRuntimeInfo);
566,941✔
407
  }
408
  taosMemoryFreeClear(pTaskInfo->sql);
411,045,456✔
409
  taosMemoryFreeClear(pTaskInfo->id.str);
411,133,439✔
410
  taosMemoryFreeClear(pTaskInfo);
410,982,192✔
411
}
410,975,823✔
412

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