Bug 4160 - null pointer exception in getDHCPServerPort()
null pointer exception in SecurityServicesImpl.getDHCPServerPort()
because neutronPortCache.getPort() may return null. It needs null check.
NOTE: the order of neutron port creation/deletion via neutron northbound
api and ovs port creation/deletion is not deterministic. Either order can
happen. SecurityServicesImpl seems to be fixed to be aware of it.
it's another story. This patch addresses only null pointer exception
for now.
> java.lang.NullPointerException
> at org.opendaylight.ovsdb.openstack.netvirt.impl.SecurityServicesImpl.getDHCPServerPort(SecurityServicesImpl.java:121)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.OF13Provider.removeLocalRules(OF13Provider.java:845)[401:org.opendaylight.ovsdb.openstack.net-virt-providers:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.OF13Provider.handleInterfaceDelete(OF13Provider.java:1148)[401:org.opendaylight.ovsdb.openstack.net-virt-providers:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.handleInterfaceDelete(SouthboundHandler.java:113)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.processPortDelete(SouthboundHandler.java:166)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.processPortEvent(SouthboundHandler.java:290)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.SouthboundHandler.processEvent(SouthboundHandler.java:233)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:95)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl.access$200(EventDispatcherImpl.java:28)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl$1.run(EventDispatcherImpl.java:57)[400:org.opendaylight.ovsdb.openstack.net-virt:1.2.0.SNAPSHOT]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_79]
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
> at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
Change-Id: I40f78b1477f1c2a6ad3e23b2e60e21be6d9abc23
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>