kirktrue commented on code in PR #14859:
URL: https://github.com/apache/kafka/pull/14859#discussion_r1411224159


##########
checkstyle/suppressions.xml:
##########
@@ -48,7 +48,7 @@
     <suppress id="dontUseSystemExit"
               files="Exit.java"/>
     <suppress checks="ClassFanOutComplexity"
-              
files="(AbstractFetch|Sender|SenderTest|ConsumerCoordinator|KafkaConsumer|PrototypeAsyncConsumer|KafkaProducer|Utils|TransactionManager|TransactionManagerTest|KafkaAdminClient|NetworkClient|Admin|KafkaRaftClient|KafkaRaftClientTest|RaftClientTestContext).java"/>

Review Comment:
   Thank you for this clean up!



##########
core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala:
##########
@@ -594,8 +594,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
     assertThrows(classOf[InvalidTopicException], () => 
consumer.partitionsFor(";3# ads,{234"))
   }
 
+  // Temporarily do not run flaky test for consumer group protocol
   @ParameterizedTest(name = 
TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
-  @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+  
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersGenericGroupProtocolOnly"))

Review Comment:
   😭 



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -653,7 +652,7 @@ public Map<TopicPartition, OffsetAndMetadata> 
committed(final Set<TopicPartition
         try {
             maybeThrowInvalidGroupIdException();
             if (partitions.isEmpty()) {
-                return new HashMap<>();
+                return Collections.emptyMap();

Review Comment:
   Does this make a difference, or just a stylistic/pet peeve/optimiz/sation 
thing?



##########
core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala:
##########
@@ -594,8 +594,9 @@ class PlaintextConsumerTest extends BaseConsumerTest {
     assertThrows(classOf[InvalidTopicException], () => 
consumer.partitionsFor(";3# ads,{234"))
   }
 
+  // Temporarily do not run flaky test for consumer group protocol
   @ParameterizedTest(name = 
TestInfoUtils.TestWithParameterizedQuorumAndGroupProtocolNames)
-  @MethodSource(Array("getTestQuorumAndGroupProtocolParametersAll"))
+  
@MethodSource(Array("getTestQuorumAndGroupProtocolParametersGenericGroupProtocolOnly"))

Review Comment:
   😭 



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -663,6 +662,10 @@ public Map<TopicPartition, OffsetAndMetadata> 
committed(final Set<TopicPartition
                     time.timer(timeout));
                 committedOffsets.forEach(this::updateLastSeenEpochIfNewer);
                 return committedOffsets;
+            } catch (TimeoutException e) {
+                throw new TimeoutException("Timeout of " + timeout.toMillis() 
+ "ms expired before the last " +
+                    "committed offset for partitions " + partitions + " could 
be determined. Try tuning default.api.timeout.ms " +

Review Comment:
   nit: please replace the literal string `default.api.timeout.ms` with the 
appropriate constant from `ConsumerConfig` 🥺 



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -663,6 +662,10 @@ public Map<TopicPartition, OffsetAndMetadata> 
committed(final Set<TopicPartition
                     time.timer(timeout));
                 committedOffsets.forEach(this::updateLastSeenEpochIfNewer);
                 return committedOffsets;
+            } catch (TimeoutException e) {
+                throw new TimeoutException("Timeout of " + timeout.toMillis() 
+ "ms expired before the last " +
+                    "committed offset for partitions " + partitions + " could 
be determined. Try tuning default.api.timeout.ms " +

Review Comment:
   nit: please replace the literal string `default.api.timeout.ms` with the 
appropriate constant from `ConsumerConfig` 🥺 



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to