Fixes a RuntimeException thrown when we try and take control of a switch we're already contending
diff --git a/mastership-test.sh b/mastership-test.sh
index 2a83b71..209ffb7 100755
--- a/mastership-test.sh
+++ b/mastership-test.sh
@@ -1,2 +1,2 @@
#java -Dlogback.configurationFile=logback.xml -cp target/floodlight-only.jar:lib/*:lib/titan/* net.onrc.onos.registry.controller.RegistryRunner $1
-java -Dlogback.configurationFile=logback.xml -cp target/floodlight-only.jar:lib/*:lib/titan/* net.floodlightcontroller.core.Main -cf onos3.properties
+java -Dlogback.configurationFile=logback.xml -cp target/floodlight-only.jar:lib/*:lib/titan/* net.floodlightcontroller.core.Main -cf onos.properties
diff --git a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
index 51335fe..025bbfe 100644
--- a/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
+++ b/src/main/java/net/onrc/onos/registry/controller/ZookeeperRegistry.java
@@ -208,8 +208,10 @@
String latchPath = switchLatchesPath + "/" + dpidStr;
if (switchLatches.get(dpidStr) != null){
- throw new RuntimeException("Leader election for switch " + dpidStr +
- "is already running");
+ //throw new RuntimeException("Leader election for switch " + dpidStr +
+ // "is already running");
+ log.debug("Already contesting {}, returning", HexString.toHexString(dpid));
+ return;
}
LeaderLatch latch = new LeaderLatch(client, latchPath, controllerId);