You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2018/04/02 03:36:34 UTC

[kafka] branch trunk updated: KAFKA-6731: waitOnState should check the state to be the target start. (#4808)

This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b8f8ce4  KAFKA-6731: waitOnState should check the state to be the target start. (#4808)
b8f8ce4 is described below

commit b8f8ce4146af4fbc7ae40380f1ff251b05bd8773
Author: huxi <hu...@hotmail.com>
AuthorDate: Mon Apr 2 11:36:25 2018 +0800

    KAFKA-6731: waitOnState should check the state to be the target start. (#4808)
    
    KafkaStreams.waitOnState() should check the state to be the given one instead of the hard-coded `NOT_RUNNING`.
    
    Reviewers: Guozhang Wang <wa...@gmail.com>
---
 streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java b/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
index 186276c..a99f8cc 100644
--- a/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
+++ b/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
@@ -215,7 +215,7 @@ public class KafkaStreams {
         long begin = time.milliseconds();
         synchronized (stateLock) {
             long elapsedMs = 0L;
-            while (state != State.NOT_RUNNING) {
+            while (state != targetState) {
                 if (waitMs == 0) {
                     try {
                         stateLock.wait();

-- 
To stop receiving notification emails like this one, please contact
guozhang@apache.org.