diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 849526e948..902e581bfd 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -1872,13 +1872,17 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) { if (tmq->epTimer == NULL){ tmq->epTimer = taosTmrStart(tmqAssignAskEpTask, DEFAULT_ASKEP_INTERVAL, (void*)(tmq->refId), tmqMgmt.timer); + if (tmq->epTimer == NULL) { + code = TSDB_CODE_TSC_INTERNAL_ERROR; + goto END; + } } if (tmq->autoCommit && tmq->commitTimer == NULL){ tmq->commitTimer = taosTmrStart(tmqAssignDelayedCommitTask, tmq->autoCommitInterval, (void*)(tmq->refId), tmqMgmt.timer); - } - if (tmq->epTimer == NULL || tmq->commitTimer == NULL) { - code = TSDB_CODE_TSC_INTERNAL_ERROR; - goto END; + if (tmq->commitTimer == NULL) { + code = TSDB_CODE_TSC_INTERNAL_ERROR; + goto END; + } } END: