Skip to content

Commit ac6d031

Browse files
committed
fix:do not send unsubscribe msg to taosd if subscribe failed
1 parent 5c57215 commit ac6d031

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/client/src/clientTmq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,10 @@ int32_t tmq_subscription(tmq_t* tmq, tmq_list_t** topics) {
985985

986986
int32_t tmq_unsubscribe(tmq_t* tmq) {
987987
if(tmq == NULL) return TSDB_CODE_INVALID_PARA;
988+
if (tmq->status != TMQ_CONSUMER_STATUS__READY) {
989+
tscInfo("consumer:0x%" PRIx64 " not in ready state, unsubscribe it directly", tmq->consumerId);
990+
return 0;
991+
}
988992
if (tmq->autoCommit) {
989993
int32_t rsp = tmq_commit_sync(tmq, NULL);
990994
if (rsp != 0) {

0 commit comments

Comments
 (0)