diff --git a/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java b/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java index 46cbc0a7da..a02159c933 100644 --- a/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java +++ b/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java @@ -562,6 +562,7 @@ public class HostManager public void hostVanished(HostId hostId) { checkNotNull(hostId, HOST_ID_NULL); checkValidity(); + // TODO SDFAB-718 rethink HostStore APIs to allow atomic operations Host host = store.getHost(hostId); if (!allowedToChange(hostId)) { @@ -569,6 +570,11 @@ public class HostManager return; } + if (host == null) { + log.info("Request to remove {} is ignored due to host not present in the store", hostId); + return; + } + if (monitorHosts) { host.ipAddresses().forEach(ip -> { monitor.stopMonitoring(ip);