lianetm commented on code in PR #17244: URL: https://github.com/apache/kafka/pull/17244#discussion_r1778507005
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -1279,7 +1281,10 @@ private void releaseAssignmentAndLeaveGroup(final Timer timer) { UnsubscribeEvent unsubscribeEvent = new UnsubscribeEvent(calculateDeadlineMs(timer)); applicationEventHandler.add(unsubscribeEvent); try { - processBackgroundEvents(unsubscribeEvent.future(), timer); + // If users subscribe to an invalid topic name, there will have InvalidTopicException in error events, Review Comment: nit: they will get (instead of "there will have") ########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -1279,7 +1281,10 @@ private void releaseAssignmentAndLeaveGroup(final Timer timer) { UnsubscribeEvent unsubscribeEvent = new UnsubscribeEvent(calculateDeadlineMs(timer)); applicationEventHandler.add(unsubscribeEvent); try { - processBackgroundEvents(unsubscribeEvent.future(), timer); + // If users subscribe to an invalid topic name, there will have InvalidTopicException in error events, + // because network thread keep trying to send MetadataRequest in the background. Review Comment: nit: keeps ########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -1805,15 +1813,23 @@ private boolean processBackgroundEvents() { * execution of the rebalancing logic. The rebalancing logic cannot complete until the * {@link ConsumerRebalanceListener} callback is performed. * - * @param future Event that contains a {@link CompletableFuture}; it is on this future that the - * application thread will wait for completion - * @param timer Overall timer that bounds how long to wait for the event to complete + * @param future Event that contains a {@link CompletableFuture}; it is on this future that the + * application thread will wait for completion + * @param timer Overall timer that bounds how long to wait for the event to complete + * @param ignoreErrorEventException Predicate to ignore background errors. + * Any exceptions found while processing background events that match the predicated won't be propagated. Review Comment: typo predicated (introduced by me actually he he, sorry) ########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -1476,7 +1481,10 @@ public void unsubscribe() { subscriptions.assignedPartitions()); try { - processBackgroundEvents(unsubscribeEvent.future(), timer); + // If users subscribe to an invalid topic name, there will have InvalidTopicException in error events, Review Comment: ditto ########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -1476,7 +1481,10 @@ public void unsubscribe() { subscriptions.assignedPartitions()); try { - processBackgroundEvents(unsubscribeEvent.future(), timer); + // If users subscribe to an invalid topic name, there will have InvalidTopicException in error events, + // because network thread keep trying to send MetadataRequest in the background. Review Comment: ditto -- 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