Use pair link before the 2nd location of a dual-homed host is not discovered
In addition,
- Improve host added log message
- Improve false cache eviction log message
Change-Id: Iece05d4a2ba76a3da4ad736c4e072ced43fecacc
diff --git a/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java b/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
index b5dcc76..8a913cd 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
@@ -117,8 +117,9 @@
case EXPIRED:
PendingHostLocation expired = notification.getValue();
if (expired != null) {
- log.info("Evict timeout probe {} from pendingHostLocations", notification.getValue());
- timeoutPendingHostLocation(notification.getKey());
+ if (timeoutPendingHostLocation(notification.getKey())) {
+ log.info("Evict {} from pendingHosts due to probe timeout", notification.getValue());
+ }
}
break;
case EXPLICIT:
@@ -401,11 +402,12 @@
pendingHosts.remove(probeMac);
}
- private void timeoutPendingHostLocation(MacAddress probeMac) {
- pendingHosts.computeIfPresent(probeMac, (k, v) -> {
+ private boolean timeoutPendingHostLocation(MacAddress probeMac) {
+ PendingHostLocation phl = pendingHosts.computeIfPresent(probeMac, (k, v) -> {
v.setExpired(true);
return v;
});
+ return phl != null;
}
private Set<Host> filter(Collection<DefaultHost> collection, Predicate<DefaultHost> predicate) {