chia7712 commented on code in PR #23702:
URL: https://github.com/apache/kafka/pull/23702#discussion_r4181105797
##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -3880,11 +3880,14 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
new Thread {
override def run : Unit = {
consumer.subscribe(util.Set.of(topic))
+ var started = false
try {
while (consumerThreadRunning.get()) {
consumer.poll(JDuration.ofSeconds(5))
- if (!consumer.assignment.isEmpty && startLatch.getCount > 0L)
+ if (!started && !consumer.assignment.isEmpty) {
Review Comment:
If we want to ensure the consumer has joined the group, using a rebalance
listener seems to be a more robust approach. Otherwise,
`consumer.assignment.isEmpty` may cause issues if the number of partitions is
less than the number of consumers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]