Skip to content
Snippets Groups Projects
Commit 5c643e7d authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

Merge pull request #264 from sriniram/master

Schedule/Reschedule discovery task if the controller role is null  or master.  
parents bd775a61 9286e6ec
No related branches found
No related tags found
No related merge requests found
...@@ -1585,10 +1585,13 @@ IFloodlightModule, IInfoProvider, IHAListener { ...@@ -1585,10 +1585,13 @@ IFloodlightModule, IInfoProvider, IHAListener {
} catch (Exception e) { } catch (Exception e) {
log.error("Exception in LLDP send timer.", e); log.error("Exception in LLDP send timer.", e);
} finally { } finally {
if (!shuttingDown && if (!shuttingDown) {
floodlightProvider.getRole() == Role.MASTER) { // null role implies HA mode is not enabled.
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, Role role = floodlightProvider.getRole();
if (role == null || role == Role.MASTER) {
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL,
TimeUnit.SECONDS); TimeUnit.SECONDS);
}
} }
} }
} }
...@@ -1607,8 +1610,10 @@ IFloodlightModule, IInfoProvider, IHAListener { ...@@ -1607,8 +1610,10 @@ IFloodlightModule, IInfoProvider, IHAListener {
}}, "Topology Updates"); }}, "Topology Updates");
updatesThread.start(); updatesThread.start();
if (floodlightProvider.getRole() == Role.MASTER) // null role implies HA mode is not enabled.
discoveryTask.reschedule(1, TimeUnit.MICROSECONDS); Role role = floodlightProvider.getRole();
if (role == null || role == Role.MASTER)
discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, TimeUnit.SECONDS);
// Register for the OpenFlow messages we want to receive // Register for the OpenFlow messages we want to receive
floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this); floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
floodlightProvider.addOFMessageListener(OFType.PORT_STATUS, this); floodlightProvider.addOFMessageListener(OFType.PORT_STATUS, this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment