GIRAPH-1201
authorDionysios Logothetis <dlogothetis@gmail.com>
Fri, 21 Sep 2018 17:24:28 +0000 (10:24 -0700)
committerDionysios Logothetis <dionysios@fb.com>
Fri, 21 Sep 2018 17:24:28 +0000 (10:24 -0700)
closes #84

giraph-core/src/main/java/org/apache/giraph/master/BspServiceMaster.java

index a95a19c..dac898e 100644 (file)
@@ -1379,9 +1379,15 @@ public class BspServiceMaster<I extends WritableComparable,
 
       // Wait for a signal or timeout
       boolean eventTriggered = event.waitMsecs(eventLoopTimeout);
+
+      // If the event was triggered, we reset it. In the next loop run, we will
+      // read ZK to get the new hosts.
+      if (eventTriggered) {
+        event.reset();
+      }
+
       long elapsedTimeSinceRegularRunMsec = System.currentTimeMillis() -
           lastRegularRunTimeMsec;
-      event.reset();
       getContext().progress();
 
       if (eventTriggered ||