abbccdda commented on a change in pull request #9354:
URL: https://github.com/apache/kafka/pull/9354#discussion_r497960618
##########
File path:
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
##########
@@ -1934,12 +1933,20 @@ public void testReturnRecordsDuringRebalance() {
fetches1.put(tp0, new FetchInfo(3, 1));
client.respondFrom(fetchResponse(fetches1), node);
- records = consumer.poll(Duration.ZERO);
+ // now complete teh rebalance
Review comment:
s/teh/the
##########
File path:
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
##########
@@ -948,7 +948,7 @@ private synchronized void resetStateAndRejoin() {
synchronized void resetGenerationOnResponseError(ApiKeys api, Errors
error) {
log.debug("Resetting generation after encountering {} from {} response
and requesting re-join", error, api);
- resetState();
+ resetStateAndRejoin();
Review comment:
It seems that we would rejoin on FENCED_INSTANCE_ID as well, is that
intentional?
https://github.com/apache/kafka/blob/bd462df20321ff5b75a7e3eae70634268582d90b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L1106
##########
File path:
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
##########
@@ -1948,10 +1955,14 @@ public void testReturnRecordsDuringRebalance() {
fetches1.put(t3p0, new FetchInfo(0, 100));
client.respondFrom(fetchResponse(fetches1), node);
- records = consumer.poll(Duration.ZERO);
+ count.set(0);
+ TestUtils.waitForCondition(() -> {
+ ConsumerRecords<String, String> recs =
consumer.poll(Duration.ofMillis(100L));
+ System.out.println("count2 " + count.addAndGet(recs.count()));
Review comment:
Same here
##########
File path:
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
##########
@@ -1934,12 +1933,20 @@ public void testReturnRecordsDuringRebalance() {
fetches1.put(tp0, new FetchInfo(3, 1));
client.respondFrom(fetchResponse(fetches1), node);
- records = consumer.poll(Duration.ZERO);
+ // now complete teh rebalance
+ client.respondFrom(syncGroupResponse(Arrays.asList(tp0, t3p0),
Errors.NONE), coordinator);
+
+ AtomicInteger count = new AtomicInteger(0);
+ TestUtils.waitForCondition(() -> {
+ ConsumerRecords<String, String> recs =
consumer.poll(Duration.ofMillis(100L));
+ System.out.println("count " + count.addAndGet(recs.count()));
Review comment:
Could we remove this print statement?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]