Skip to content

Commit 8effbf2

Browse files
committed
Some refinement, -- clear the pending flag for subscribe/unsubscribe(...) timeout cases
1 parent 341c318 commit 8effbf2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/kafka/KafkaConsumer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ KafkaConsumer::subscribe(const Topics& topics, Consumer::RebalanceCallback rebal
404404
}
405405
}
406406

407+
_pendingEvent.reset();
407408
KAFKA_THROW_ERROR(Error(RD_KAFKA_RESP_ERR__TIMED_OUT, "subscribe() timed out!"));
408409
}
409410

@@ -448,6 +449,7 @@ KafkaConsumer::unsubscribe(std::chrono::milliseconds timeout)
448449
}
449450
}
450451

452+
_pendingEvent.reset();
451453
KAFKA_THROW_ERROR(Error(RD_KAFKA_RESP_ERR__TIMED_OUT, "unsubscribe() timed out!"));
452454
}
453455

0 commit comments

Comments
 (0)