HIGUCHI Yuta
Committed by Gerrit Code Review

Ignore event if not ready to serve as MASTER

- Issue similar to ONOS-1208 on Device Store

Change-Id: I1f3922f29d66ff68c18e364aff27ded414664889
......@@ -1488,6 +1488,11 @@ public class GossipDeviceStore
ProviderId providerId = event.providerId();
DeviceId deviceId = event.deviceId();
DeviceDescription deviceDescription = event.deviceDescription();
if (!deviceClockService.isTimestampAvailable(deviceId)) {
// workaround for ONOS-1208
log.warn("Not ready to accept update. Dropping {}", deviceDescription);
return;
}
try {
createOrUpdateDevice(providerId, deviceId, deviceDescription);
......@@ -1508,6 +1513,11 @@ public class GossipDeviceStore
ProviderId providerId = event.providerId();
DeviceId deviceId = event.deviceId();
List<PortDescription> portDescriptions = event.portDescriptions();
if (!deviceClockService.isTimestampAvailable(deviceId)) {
// workaround for ONOS-1208
log.warn("Not ready to accept update. Dropping {}", portDescriptions);
return;
}
try {
updatePorts(providerId, deviceId, portDescriptions);
......