From 5e7190cf83860190d54815aab957a58c26fd816e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Rohde=20D=C3=B8ssing?= Date: Fri, 4 Nov 2016 00:37:18 -0700 Subject: [PATCH] MINOR: Add description of how consumer wakeup acts if no threads are awakened MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think the Javadoc should describe what happens if wakeup is called and no other thread is currently blocking. This may be important in some cases, e.g. trying to shut down a poll thread, followed by manually committing offsets. Author: Stig Rohde Døssing Reviewers: Jason Gustafson Closes #2093 from srdo/minor-expand-wakeup-javadoc --- .../java/org/apache/kafka/clients/consumer/KafkaConsumer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java index b384211e3d8..fe53fb1ca43 100644 --- a/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java +++ b/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java @@ -1475,6 +1475,7 @@ public class KafkaConsumer implements Consumer { /** * 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. */ @Override public void wakeup() {