stream.c 15.5 KB
Newer Older
L
Liu Jicong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

16
#include "streamInt.h"
17
#include "ttimer.h"
L
Liu Jicong 已提交
18

19
#define STREAM_TASK_INPUT_QUEUE_CAPACITY          20480
20
#define STREAM_TASK_INPUT_QUEUE_CAPACITY_IN_SIZE  (30)
H
Haojun Liao 已提交
21
#define ONE_MB_F                                  (1048576.0)
dengyihao's avatar
dengyihao 已提交
22
#define QUEUE_MEM_SIZE_IN_MB(_q)                  (taosQueueMemorySize(_q) / ONE_MB_F)
23

24 25
SStreamGlobalEnv streamEnv;

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
int32_t streamInit() {
  int8_t old;
  while (1) {
    old = atomic_val_compare_exchange_8(&streamEnv.inited, 0, 2);
    if (old != 2) break;
  }

  if (old == 0) {
    streamEnv.timer = taosTmrInit(10000, 100, 10000, "STREAM");
    if (streamEnv.timer == NULL) {
      atomic_store_8(&streamEnv.inited, 0);
      return -1;
    }
    atomic_store_8(&streamEnv.inited, 1);
  }
41

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
  return 0;
}

void streamCleanUp() {
  int8_t old;
  while (1) {
    old = atomic_val_compare_exchange_8(&streamEnv.inited, 1, 2);
    if (old != 2) break;
  }

  if (old == 1) {
    taosTmrCleanUp(streamEnv.timer);
    atomic_store_8(&streamEnv.inited, 0);
  }
}

58 59 60 61 62 63
char* createStreamTaskIdStr(int64_t streamId, int32_t taskId) {
  char buf[128] = {0};
  sprintf(buf, "0x%" PRIx64 "-0x%x", streamId, taskId);
  return taosStrdup(buf);
}

H
Haojun Liao 已提交
64
static void streamSchedByTimer(void* param, void* tmrId) {
65 66
  SStreamTask* pTask = (void*)param;

67 68 69
  int8_t status = atomic_load_8(&pTask->triggerStatus);
  qDebug("s-task:%s in scheduler timer, trigger status:%d", pTask->id.idStr, status);

L
liuyao 已提交
70
  if (streamTaskShouldStop(&pTask->status) || streamTaskShouldPause(&pTask->status)) {
L
Liu Jicong 已提交
71
    streamMetaReleaseTask(NULL, pTask);
72
    qDebug("s-task:%s jump out of schedTimer", pTask->id.idStr);
L
Liu Jicong 已提交
73 74 75
    return;
  }

76
  if (status == TASK_TRIGGER_STATUS__ACTIVE) {
S
Shengliang Guan 已提交
77
    SStreamTrigger* trigger = taosAllocateQitem(sizeof(SStreamTrigger), DEF_QITEM, 0);
78 79 80 81
    if (trigger == NULL) {
      return;
    }

L
Liu Jicong 已提交
82
    trigger->type = STREAM_INPUT__GET_RES;
83 84 85 86 87 88
    trigger->pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock));
    if (trigger->pBlock == NULL) {
      taosFreeQitem(trigger);
      return;
    }

89
    trigger->pBlock->info.type = STREAM_GET_ALL;
90
    atomic_store_8(&pTask->triggerStatus, TASK_TRIGGER_STATUS__INACTIVE);
91

92
    if (tAppendDataToInputQueue(pTask, (SStreamQueueItem*)trigger) < 0) {
L
Liu Jicong 已提交
93
      taosFreeQitem(trigger);
94
      taosTmrReset(streamSchedByTimer, (int32_t)pTask->triggerParam, pTask, streamEnv.timer, &pTask->schedTimer);
L
Liu Jicong 已提交
95 96
      return;
    }
97

L
Liu Jicong 已提交
98
    streamSchedExec(pTask);
99 100
  }

101
  taosTmrReset(streamSchedByTimer, (int32_t)pTask->triggerParam, pTask, streamEnv.timer, &pTask->schedTimer);
102 103
}

104
int32_t streamSetupScheduleTrigger(SStreamTask* pTask) {
105
  if (pTask->triggerParam != 0) {
L
Liu Jicong 已提交
106
    int32_t ref = atomic_add_fetch_32(&pTask->refCnt, 1);
107 108
    ASSERT(ref == 2 && pTask->schedTimer == NULL);

H
Haojun Liao 已提交
109
    qDebug("s-task:%s setup scheduler trigger, delay:%"PRId64" ms", pTask->id.idStr, pTask->triggerParam);
110 111

    pTask->schedTimer = taosTmrStart(streamSchedByTimer, (int32_t)pTask->triggerParam, pTask, streamEnv.timer);
112
    pTask->triggerStatus = TASK_TRIGGER_STATUS__INACTIVE;
113
  }
114

115 116 117
  return 0;
}

L
Liu Jicong 已提交
118
int32_t streamSchedExec(SStreamTask* pTask) {
dengyihao's avatar
dengyihao 已提交
119 120
  int8_t schedStatus = atomic_val_compare_exchange_8(&pTask->status.schedStatus, TASK_SCHED_STATUS__INACTIVE,
                                                     TASK_SCHED_STATUS__WAITING);
121

L
Liu Jicong 已提交
122 123 124
  if (schedStatus == TASK_SCHED_STATUS__INACTIVE) {
    SStreamTaskRunReq* pRunReq = rpcMallocCont(sizeof(SStreamTaskRunReq));
    if (pRunReq == NULL) {
125
      terrno = TSDB_CODE_OUT_OF_MEMORY;
126
      atomic_store_8(&pTask->status.schedStatus, TASK_SCHED_STATUS__INACTIVE);
127
      qError("failed to create msg to aunch s-task:%s, reason out of memory", pTask->id.idStr);
L
Liu Jicong 已提交
128 129
      return -1;
    }
130

131
    pRunReq->head.vgId = pTask->info.nodeId;
132 133
    pRunReq->streamId = pTask->id.streamId;
    pRunReq->taskId = pTask->id.taskId;
134

135 136
    qDebug("trigger to run s-task:%s", pTask->id.idStr);

dengyihao's avatar
dengyihao 已提交
137
    SRpcMsg msg = {.msgType = TDMT_STREAM_TASK_RUN, .pCont = pRunReq, .contLen = sizeof(SStreamTaskRunReq)};
L
Liu Jicong 已提交
138
    tmsgPutToQueue(pTask->pMsgCb, STREAM_QUEUE, &msg);
139 140
  } else {
    qDebug("s-task:%s not launch task since sched status:%d", pTask->id.idStr, pTask->status.schedStatus);
L
Liu Jicong 已提交
141
  }
142

L
Liu Jicong 已提交
143 144 145
  return 0;
}

146
int32_t streamTaskEnqueueBlocks(SStreamTask* pTask, const SStreamDispatchReq* pReq, SRpcMsg* pRsp) {
147
  int8_t status = 0;
148 149 150

  SStreamDataBlock* pBlock = createStreamDataFromDispatchMsg(pReq, STREAM_INPUT__DATA_BLOCK, pReq->dataSrcVgId);
  if (pBlock == NULL) {
151 152
    streamTaskInputFail(pTask);
    status = TASK_INPUT_STATUS__FAILED;
153
    qError("vgId:%d, s-task:%s failed to receive dispatch msg, reason: out of memory", pTask->pMeta->vgId,
154
           pTask->id.idStr);
155
  } else {
156 157 158
    int32_t code = tAppendDataToInputQueue(pTask, (SStreamQueueItem*)pBlock);
    // input queue is full, upstream is blocked now
    status = (code == TSDB_CODE_SUCCESS)? TASK_INPUT_STATUS__NORMAL:TASK_INPUT_STATUS__BLOCKED;
L
Liu Jicong 已提交
159 160 161
  }

  // rsp by input status
162
  void* buf = rpcMallocCont(sizeof(SMsgHead) + sizeof(SStreamDispatchRsp));
L
Liu Jicong 已提交
163
  ((SMsgHead*)buf)->vgId = htonl(pReq->upstreamNodeId);
164
  SStreamDispatchRsp* pDispatchRsp = POINTER_SHIFT(buf, sizeof(SMsgHead));
165

166 167 168 169
  pDispatchRsp->inputStatus = status;
  pDispatchRsp->streamId = htobe64(pReq->streamId);
  pDispatchRsp->upstreamNodeId = htonl(pReq->upstreamNodeId);
  pDispatchRsp->upstreamTaskId = htonl(pReq->upstreamTaskId);
170
  pDispatchRsp->downstreamNodeId = htonl(pTask->info.nodeId);
171 172 173
  pDispatchRsp->downstreamTaskId = htonl(pTask->id.taskId);

  pRsp->pCont = buf;
L
Liu Jicong 已提交
174 175
  pRsp->contLen = sizeof(SMsgHead) + sizeof(SStreamDispatchRsp);
  tmsgSendRsp(pRsp);
176

L
Liu Jicong 已提交
177 178 179 180
  return status == TASK_INPUT_STATUS__NORMAL ? 0 : -1;
}

int32_t streamTaskEnqueueRetrieve(SStreamTask* pTask, SStreamRetrieveReq* pReq, SRpcMsg* pRsp) {
S
Shengliang Guan 已提交
181
  SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, 0);
L
Liu Jicong 已提交
182 183 184 185
  int8_t            status = TASK_INPUT_STATUS__NORMAL;

  // enqueue
  if (pData != NULL) {
186 187
    qDebug("s-task:%s (child %d) recv retrieve req from task:0x%x(vgId:%d), reqId:0x%" PRIx64, pTask->id.idStr, pTask->info.selfChildId,
           pReq->srcTaskId, pReq->srcNodeId, pReq->reqId);
L
Liu Jicong 已提交
188

189
    pData->type = STREAM_INPUT__DATA_RETRIEVE;
L
Liu Jicong 已提交
190 191
    pData->srcVgId = 0;
    streamRetrieveReqToData(pReq, pData);
192
    if (tAppendDataToInputQueue(pTask, (SStreamQueueItem*)pData) == 0) {
L
Liu Jicong 已提交
193 194 195 196
      status = TASK_INPUT_STATUS__NORMAL;
    } else {
      status = TASK_INPUT_STATUS__FAILED;
    }
197
  } else {  // todo handle oom
L
Liu Jicong 已提交
198 199 200 201 202 203 204 205 206 207 208
    /*streamTaskInputFail(pTask);*/
    /*status = TASK_INPUT_STATUS__FAILED;*/
  }

  // rsp by input status
  void* buf = rpcMallocCont(sizeof(SMsgHead) + sizeof(SStreamRetrieveRsp));
  ((SMsgHead*)buf)->vgId = htonl(pReq->srcNodeId);
  SStreamRetrieveRsp* pCont = POINTER_SHIFT(buf, sizeof(SMsgHead));
  pCont->streamId = pReq->streamId;
  pCont->rspToTaskId = pReq->srcTaskId;
  pCont->rspFromTaskId = pReq->dstTaskId;
209
  pRsp->pCont = buf;
210
  pRsp->contLen = sizeof(SMsgHead) + sizeof(SStreamRetrieveRsp);
L
Liu Jicong 已提交
211
  tmsgSendRsp(pRsp);
212

L
Liu Jicong 已提交
213 214 215
  return status == TASK_INPUT_STATUS__NORMAL ? 0 : -1;
}

216 217
// todo add log
int32_t streamTaskOutputResultBlock(SStreamTask* pTask, SStreamDataBlock* pBlock) {
dengyihao's avatar
dengyihao 已提交
218
  int32_t code = 0;
L
Liu Jicong 已提交
219 220
  if (pTask->outputType == TASK_OUTPUT__TABLE) {
    pTask->tbSink.tbSinkFunc(pTask, pTask->tbSink.vnode, 0, pBlock->blocks);
221
    destroyStreamDataBlock(pBlock);
L
Liu Jicong 已提交
222 223
  } else if (pTask->outputType == TASK_OUTPUT__SMA) {
    pTask->smaSink.smaSink(pTask->smaSink.vnode, pTask->smaSink.smaId, pBlock->blocks);
224
    destroyStreamDataBlock(pBlock);
L
Liu Jicong 已提交
225 226
  } else {
    ASSERT(pTask->outputType == TASK_OUTPUT__FIXED_DISPATCH || pTask->outputType == TASK_OUTPUT__SHUFFLE_DISPATCH);
dengyihao's avatar
dengyihao 已提交
227
    code = taosWriteQitem(pTask->outputQueue->queue, pBlock);
H
Haojun Liao 已提交
228
    if (code != 0) {  // todo failed to add it into the output queue, free it.
dengyihao's avatar
dengyihao 已提交
229 230
      return code;
    }
231

232
    streamDispatchStreamBlock(pTask);
L
Liu Jicong 已提交
233
  }
234

L
Liu Jicong 已提交
235 236 237
  return 0;
}

238 239 240
int32_t streamProcessDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pReq, SRpcMsg* pRsp, bool exec) {
  qDebug("s-task:%s receive dispatch msg from taskId:0x%x(vgId:%d), msgLen:%" PRId64, pTask->id.idStr,
         pReq->upstreamTaskId, pReq->upstreamNodeId, pReq->totalLen);
L
Liu Jicong 已提交
241

242
  // todo add the input queue buffer limitation
243
  streamTaskEnqueueBlocks(pTask, pReq, pRsp);
L
Liu Jicong 已提交
244
  tDeleteStreamDispatchReq(pReq);
L
Liu Jicong 已提交
245

L
Liu Jicong 已提交
246
  if (exec) {
L
Liu Jicong 已提交
247 248 249
    if (streamTryExec(pTask) < 0) {
      return -1;
    }
L
Liu Jicong 已提交
250
  } else {
L
Liu Jicong 已提交
251
    streamSchedExec(pTask);
252
  }
L
Liu Jicong 已提交
253 254 255 256

  return 0;
}

257
// todo record the idle time for dispatch data
258
int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, int32_t code) {
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
  if (code != TSDB_CODE_SUCCESS) {
    // dispatch message failed: network error, or node not available.
    // in case of the input queue is full, the code will be TSDB_CODE_SUCCESS, the and pRsp>inputStatus will be set
    // flag. here we need to retry dispatch this message to downstream task immediately. handle the case the failure
    // happened too fast. todo handle the shuffle dispatch failure
    qError("s-task:%s failed to dispatch msg to task:0x%x, code:%s, retry cnt:%d", pTask->id.idStr,
           pRsp->downstreamTaskId, tstrerror(code), ++pTask->msgInfo.retryCount);
    int32_t ret = streamDispatchAllBlocks(pTask, pTask->msgInfo.pData);
    if (ret != TSDB_CODE_SUCCESS) {

    }

    return TSDB_CODE_SUCCESS;
  }

274
  qDebug("s-task:%s receive dispatch rsp, output status:%d code:%d", pTask->id.idStr, pRsp->inputStatus, code);
L
Liu Jicong 已提交
275

276
  // there are other dispatch message not response yet
277
  if (pTask->outputType == TASK_OUTPUT__SHUFFLE_DISPATCH) {
L
Liu Jicong 已提交
278
    int32_t leftRsp = atomic_sub_fetch_32(&pTask->shuffleDispatcher.waitingRspCnt, 1);
279
    qDebug("s-task:%s is shuffle, left waiting rsp %d", pTask->id.idStr, leftRsp);
280 281 282
    if (leftRsp > 0) {
      return 0;
    }
L
Liu Jicong 已提交
283 284
  }

285
  pTask->msgInfo.retryCount = 0;
H
Haojun Liao 已提交
286
  ASSERT(pTask->outputStatus == TASK_OUTPUT_STATUS__WAIT);
287

288 289
  qDebug("s-task:%s output status is set to:%d", pTask->id.idStr, pTask->outputStatus);

290 291
  // the input queue of the (down stream) task that receive the output data is full,
  // so the TASK_INPUT_STATUS_BLOCKED is rsp
292
  // todo blocking the output status
H
Haojun Liao 已提交
293
  if (pRsp->inputStatus == TASK_INPUT_STATUS__BLOCKED) {
294 295 296 297 298 299 300 301 302 303
    pTask->msgInfo.blockingTs = taosGetTimestampMs(); // record the blocking start time

    int32_t waitDuration = 300; //  300 ms
    qError("s-task:%s inputQ of downstream task:0x%x is full, time:%" PRId64 "wait for %dms and retry dispatch data",
           pTask->id.idStr, pRsp->downstreamTaskId, pTask->msgInfo.blockingTs, waitDuration);
    streamRetryDispatchStreamBlock(pTask, waitDuration);
  } else { // pipeline send data in output queue
    // this message has been sent successfully, let's try next one.
    destroyStreamDataBlock(pTask->msgInfo.pData);
    pTask->msgInfo.pData = NULL;
304

305 306 307 308 309 310 311
    if (pTask->msgInfo.blockingTs != 0) {
      int64_t el = taosGetTimestampMs() - pTask->msgInfo.blockingTs;
      qDebug("s-task:%s resume to normal from inputQ blocking, idle time:%"PRId64"ms", pTask->id.idStr, el);
      pTask->msgInfo.blockingTs = 0;
    }

    // now ready for next data output
312 313
    atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL);

314 315
    // otherwise, continue dispatch the first block to down stream task in pipeline
    streamDispatchStreamBlock(pTask);
L
Liu Jicong 已提交
316
  }
H
Haojun Liao 已提交
317

L
Liu Jicong 已提交
318 319 320
  return 0;
}

L
Liu Jicong 已提交
321
int32_t streamProcessRunReq(SStreamTask* pTask) {
L
Liu Jicong 已提交
322 323 324
  if (streamTryExec(pTask) < 0) {
    return -1;
  }
L
Liu Jicong 已提交
325

326
  /*if (pTask->dispatchType == TASK_OUTPUT__FIXED_DISPATCH || pTask->dispatchType == TASK_OUTPUT__SHUFFLE_DISPATCH) {*/
327
  /*streamDispatchStreamBlock(pTask);*/
L
Liu Jicong 已提交
328
  /*}*/
L
Liu Jicong 已提交
329 330 331
  return 0;
}

L
Liu Jicong 已提交
332 333
int32_t streamProcessRetrieveReq(SStreamTask* pTask, SStreamRetrieveReq* pReq, SRpcMsg* pRsp) {
  streamTaskEnqueueRetrieve(pTask, pReq, pRsp);
334
  ASSERT(pTask->info.taskLevel != TASK_LEVEL__SINK);
L
Liu Jicong 已提交
335
  streamSchedExec(pTask);
L
Liu Jicong 已提交
336 337 338
  return 0;
}

339
bool tInputQueueIsFull(const SStreamTask* pTask) {
340
  bool   isFull = taosQueueItemSize((pTask->inputQueue->queue)) >= STREAM_TASK_INPUT_QUEUE_CAPACITY;
341
  double size = QUEUE_MEM_SIZE_IN_MB(pTask->inputQueue->queue);
342
  return (isFull || size >= STREAM_TASK_INPUT_QUEUE_CAPACITY_IN_SIZE);
343 344
}

345
int32_t tAppendDataToInputQueue(SStreamTask* pTask, SStreamQueueItem* pItem) {
346 347 348
  int8_t  type = pItem->type;
  int32_t total = taosQueueItemSize(pTask->inputQueue->queue) + 1;
  double  size = QUEUE_MEM_SIZE_IN_MB(pTask->inputQueue->queue);
349 350

  if (type == STREAM_INPUT__DATA_SUBMIT) {
351
    SStreamDataSubmit* px = (SStreamDataSubmit*)pItem;
352
    if ((pTask->info.taskLevel == TASK_LEVEL__SOURCE) && tInputQueueIsFull(pTask)) {
353
      qError("s-task:%s input queue is full, capacity(size:%d num:%dMiB), current(blocks:%d, size:%.2fMiB) stop to push data",
354
             pTask->id.idStr, STREAM_TASK_INPUT_QUEUE_CAPACITY, STREAM_TASK_INPUT_QUEUE_CAPACITY_IN_SIZE, total,
dengyihao's avatar
dengyihao 已提交
355 356 357
             size);
      streamDataSubmitDestroy(px);
      taosFreeQitem(pItem);
358 359
      return -1;
    }
360

361 362 363 364 365 366
    int32_t code = taosWriteQitem(pTask->inputQueue->queue, pItem);
    if (code != TSDB_CODE_SUCCESS) {
      streamDataSubmitDestroy(px);
      taosFreeQitem(pItem);
      return code;
    }
367 368 369

    qDebug("s-task:%s submit enqueue msgLen:%d ver:%" PRId64 ", total in queue:%d, size:%.2fMiB", pTask->id.idStr,
           px->submit.msgLen, px->submit.ver, total, size + px->submit.msgLen/1048576.0);
370 371
  } else if (type == STREAM_INPUT__DATA_BLOCK || type == STREAM_INPUT__DATA_RETRIEVE ||
             type == STREAM_INPUT__REF_DATA_BLOCK) {
372
    if ((pTask->info.taskLevel == TASK_LEVEL__SOURCE) && (tInputQueueIsFull(pTask))) {
H
Haojun Liao 已提交
373
      qError("s-task:%s input queue is full, capacity:%d size:%d MiB, current(blocks:%d, size:%.2fMiB) abort",
374
             pTask->id.idStr, STREAM_TASK_INPUT_QUEUE_CAPACITY, STREAM_TASK_INPUT_QUEUE_CAPACITY_IN_SIZE, total,
H
Haojun Liao 已提交
375
             size);
376
      destroyStreamDataBlock((SStreamDataBlock*) pItem);
377 378 379
      return -1;
    }

H
Haojun Liao 已提交
380
    qDebug("s-task:%s data block enqueue, current(blocks:%d, size:%.2fMiB)", pTask->id.idStr, total, size);
381 382 383 384 385
    int32_t code = taosWriteQitem(pTask->inputQueue->queue, pItem);
    if (code != TSDB_CODE_SUCCESS) {
      destroyStreamDataBlock((SStreamDataBlock*) pItem);
      return code;
    }
386 387 388
  } else if (type == STREAM_INPUT__CHECKPOINT) {
    taosWriteQitem(pTask->inputQueue->queue, pItem);
  } else if (type == STREAM_INPUT__GET_RES) {
389
    // use the default memory limit, refactor later.
390
    taosWriteQitem(pTask->inputQueue->queue, pItem);
H
Haojun Liao 已提交
391
    qDebug("s-task:%s data res enqueue, current(blocks:%d, size:%.2fMiB)", pTask->id.idStr, total, size);
392 393 394 395 396 397 398
  }

  if (type != STREAM_INPUT__GET_RES && type != STREAM_INPUT__CHECKPOINT && pTask->triggerParam != 0) {
    atomic_val_compare_exchange_8(&pTask->triggerStatus, TASK_TRIGGER_STATUS__INACTIVE, TASK_TRIGGER_STATUS__ACTIVE);
  }

  return 0;
399 400
}

401 402
static void* streamQueueCurItem(SStreamQueue* queue) { return queue->qItem; }

403 404 405 406 407 408
void* streamQueueNextItem(SStreamQueue* pQueue) {
  int8_t flag = atomic_exchange_8(&pQueue->status, STREAM_QUEUE__PROCESSING);

  if (flag == STREAM_QUEUE__FAILED) {
    ASSERT(pQueue->qItem != NULL);
    return streamQueueCurItem(pQueue);
409
  } else {
410 411 412 413 414
    pQueue->qItem = NULL;
    taosGetQitem(pQueue->qall, &pQueue->qItem);
    if (pQueue->qItem == NULL) {
      taosReadAllQitems(pQueue->queue, pQueue->qall);
      taosGetQitem(pQueue->qall, &pQueue->qItem);
415
    }
416 417

    return streamQueueCurItem(pQueue);
418
  }
419 420
}

dengyihao's avatar
dengyihao 已提交
421
void streamTaskInputFail(SStreamTask* pTask) { atomic_store_8(&pTask->inputStatus, TASK_INPUT_STATUS__FAILED); }