ableegoldman commented on code in PR #19546: URL: https://github.com/apache/kafka/pull/19546#discussion_r2061079573
########## clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java: ########## @@ -1797,31 +1801,48 @@ public void close() { * @throws InterruptException If the thread is interrupted before or while this function is called * @throws org.apache.kafka.common.KafkaException for any other error during close */ + @Deprecated(since = "4.1") @Override - @SuppressWarnings("deprecation") public void close(Duration timeout) { delegate.close(timeout); } /** - * Wakeup the consumer. This method is thread-safe and is useful in particular to abort a long poll. - * The thread which is blocking in an operation will throw {@link org.apache.kafka.common.errors.WakeupException}. - * If no thread is blocking in a method which can throw {@link org.apache.kafka.common.errors.WakeupException}, the next call to such a method will raise it instead. + * Close the consumer cleanly. {@link CloseOptions} allows to specify a timeout and a + * {@link CloseOptions.GroupMembershipOperation leave group behavior}. + * If no timeout is specified, the default timeout of 30 seconds is used. + * If no leave group behavior is specified, the {@link CloseOptions.GroupMembershipOperation#DEFAULT default + * leave group behavior} is used. + * <p> + * This method waits up to the timeout for the consumer to complete pending commits and maybe leaves the group, Review Comment: i don't know the proper grammar terminology here but essentially it's because the "maybe leave the group" is part of the X in the sentence "this method waits up to the timeout for the consumer to X" here the "maybe leave the group" comes after an "and" which can be amiguous but in this context I think it makes more sense for it to be part of the X, ie "this method waits up to the timeout for the consumer to (complete pending commits and maybe leave the group)" so its should be conjugated the same way as the thing before the and, ie the "complete pending commits" since it's "complete" and not "completes", it should also be "leave" and not "leaves" -- 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