Revert "[FLINK-6509] [tests] Perform TestingListener#waitForNewLeader under 
lock"

This reverts commit d88a62f9c0030a35ffdec5c252c8428ab8960521.


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

Branch: refs/heads/release-1.3
Commit: cc6036fd50b243ff075ce17aef3b26680571bb14
Parents: c5efae5
Author: Stefan Richter <[email protected]>
Authored: Sun May 14 15:37:16 2017 +0200
Committer: Stefan Richter <[email protected]>
Committed: Sun May 14 15:37:16 2017 +0200

----------------------------------------------------------------------
 .../apache/flink/runtime/leaderelection/TestingListener.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/cc6036fd/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingListener.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingListener.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingListener.java
index 8571505..87decc7 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingListener.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingListener.java
@@ -51,11 +51,11 @@ public class TestingListener implements 
LeaderRetrievalListener {
                long start = System.currentTimeMillis();
                long curTimeout;
 
-               synchronized (lock) {
-                       while (
+               while (
                                exception == null &&
-                                       (address == null || 
address.equals(oldAddress)) &&
-                                       (curTimeout = timeout - 
System.currentTimeMillis() + start) > 0) {
+                               (address == null || address.equals(oldAddress)) 
&&
+                               (curTimeout = timeout - 
System.currentTimeMillis() + start) > 0) {
+                       synchronized (lock) {
                                try {
                                        lock.wait(curTimeout);
                                } catch (InterruptedException e) {

Reply via email to