We should not be touching instance identifier if the node does
not exist in connection manager. Fixes the following splat:
java.lang.NullPointerException: null
at org.opendaylight.ovsdb.southbound.OvsdbDataTreeChangeListener.disconnect(OvsdbDataTreeChangeListener.java:151) ~[bundleFile:?]
at org.opendaylight.ovsdb.southbound.OvsdbDataTreeChangeListener.onDataTreeChanged(OvsdbDataTreeChangeListener.java:103) ~[bundleFile:?]
at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(BindingDOMDataTreeChangeListenerAdapter.java:37) ~[bundleFile:?]
at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.dataTreeChanged(DataTreeChangeListenerActor.java:83) [bundleFile:?]
at org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.handleReceive(DataTreeChangeListenerActor.java:44) [bundleFile:?]
Change-Id: Ibabc7f5324742fce04bc6f02b54a1ead945b15cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
try {
cm.disconnect(ovsdbNode);
LOG.info("OVSDB node has been disconnected:{}", ovsdbNode);
- cm.stopConnectionReconciliationIfActive(iid.firstIdentifierOf(Node.class), ovsdbNode);
+ if (iid != null) {
+ cm.stopConnectionReconciliationIfActive(iid.firstIdentifierOf(Node.class), ovsdbNode);
+ }
} catch (UnknownHostException e) {
LOG.warn("Failed to disconnect ovsdbNode", e);
}