kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: KAFKA-5806; Fix transient unit test failure in trogdor coordinator shutdown
Date Thu, 31 Aug 2017 20:19:43 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 47c275349 -> ded874117


KAFKA-5806; Fix transient unit test failure in trogdor coordinator shutdown

In the coordinator, we should check that 'shutdown' is not true before going to sleep waiting
for the condition.

Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Apurva Mehta <apurva@confluent.io>, Jason Gustafson <jason@confluent.io>

Closes #3755 from cmccabe/KAFKA-5806


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/ded87411
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/ded87411
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/ded87411

Branch: refs/heads/trunk
Commit: ded8741173854c98f3be0525403b6a17a55b6027
Parents: 47c2753
Author: Colin P. Mccabe <cmccabe@confluent.io>
Authored: Thu Aug 31 13:19:28 2017 -0700
Committer: Jason Gustafson <jason@confluent.io>
Committed: Thu Aug 31 13:19:28 2017 -0700

----------------------------------------------------------------------
 .../apache/kafka/trogdor/coordinator/Coordinator.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ded87411/tools/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java
----------------------------------------------------------------------
diff --git a/tools/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java b/tools/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java
index 1f71fc5..2759a36 100644
--- a/tools/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java
+++ b/tools/src/main/java/org/apache/kafka/trogdor/coordinator/Coordinator.java
@@ -130,16 +130,19 @@ public final class Coordinator {
                     List<Fault> toStart = new ArrayList<>();
                     lock.lock();
                     try {
+                        if (shutdown) {
+                            break;
+                        }
                         if (nextWakeMs > now) {
                             if (cond.await(nextWakeMs - now, TimeUnit.MILLISECONDS)) {
                                 log.trace("CoordinatorRunnable woke up early.");
                             }
+                            now = time.milliseconds();
+                            if (shutdown) {
+                                break;
+                            }
                         }
                         nextWakeMs = now + (60L * 60L * 1000L);
-                        if (shutdown) {
-                            log.info("CoordinatorRunnable shutting down.");
-                            return;
-                        }
                         Iterator<Fault> iter = pendingFaults.iterateByStart();
                         while (iter.hasNext()) {
                             Fault fault = iter.next();


Mime
View raw message