[SDFAB-16][SDFAB-17] Several improvements to the GDP
- Avoid the cancelling of the periodic checkup tasks
- Fix periodic reconciliation of the GDP
- Fix discover ports at the startup
Change-Id: I83c33208d41c674ac47f1d11bd3c81051ad800b1
diff --git a/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java b/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java
index c466d73..6b19cc8 100644
--- a/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java
+++ b/providers/general/device/src/main/java/org/onosproject/provider/general/device/impl/GeneralDeviceProvider.java
@@ -520,7 +520,8 @@
this::submitCheckupTasksForAllDevices,
1,
checkupInterval,
- TimeUnit.SECONDS);
+ TimeUnit.SECONDS,
+ true);
}
}
@@ -633,18 +634,20 @@
}
private void createOrUpdateDevice(DeviceId deviceId, boolean available) {
- if (deviceService.getDevice(deviceId) != null
- && deviceService.isAvailable(deviceId) == available) {
- // Other nodes might have advertised this device before us.
- return;
- }
assertConfig(deviceId);
+
if (available) {
// Push port descriptions. If marking online, make sure to update
// ports before other subsystems pick up the device event.
final List<PortDescription> ports = getPortDetails(deviceId);
providerService.updatePorts(deviceId, ports);
}
+
+ if (deviceService.getDevice(deviceId) != null
+ && deviceService.isAvailable(deviceId) == available) {
+ // Other nodes might have advertised this device before us.
+ return;
+ }
providerService.deviceConnected(deviceId, getDeviceDescription(
deviceId, available));
}