Do not update port stats in event dispatcher thread
+ minor fixes
Change-Id: I5beb5edd4d1f5b634c1b919e5186884e29bf73b1
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 c439094..f735006 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
@@ -790,18 +790,18 @@
DeviceId deviceId = event.subject().id();
if (type.equals((Type.DEVICE_ADDED))) {
+ // FIXME handling for mastership change scenario missing?
+
//For now this is scheduled periodically, when streaming API will
// be available we check and base it on the streaming API (e.g. gNMI)
if (mastershipService.isLocalMaster(deviceId)) {
scheduledTasks.put(deviceId, schedulePolling(deviceId, false));
- updatePortStatistics(deviceId);
}
} else if (type.equals(Type.DEVICE_REMOVED)) {
//Passing the whole device object to get driver information
- connectionExecutor.submit(exceptionSafe(() ->
- disconnectDevice(event.subject())));
+ connectionExecutor.execute(() -> disconnectDevice(event.subject()));
}
}