Bug 4733 - impl/SecurityServicesImpl.java: null pointer exception 43/30943/1
authorIsaku Yamahata <isaku.yamahata@intel.com>
Mon, 7 Dec 2015 21:36:48 +0000 (13:36 -0800)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Tue, 8 Dec 2015 02:30:36 +0000 (18:30 -0800)
commit615801db99f731af1dba72bd8cc88fb42ae7aaaf
tree49964fd20059a05fead5d116892ab58a66ce1d80
parente05b6e876b3e9841b064f6bd5eaf8961e7ab78ab
Bug 4733 - impl/SecurityServicesImpl.java: null pointer exception

This patch masks the following null pointer exception.
The code assumes that there is always nodes(ovs switch) corresponding to
neutron port always exists. But this is not always true because there are
race conditions and some tempests tests only run neutron without nova.
So the code shouldn't assume that nodes always exists and also external
attributes in ovsdb always exists. The latter case will be addressed by
another patch.
NOTE: this patch only addresses null pointer exception. The race condition
should be handled somehow later.

> 2015-12-03 18:48:15,562 | ERROR | ntDispatcherImpl | TenantNetworkManagerImpl         | 267 - org.opendaylight.ovsdb.openstack.net-virt - 1.2.1.SNAPSHOT | Exception during handlingNeutron network delete
> java.lang.NullPointerException
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.SouthboundImpl.extractTerminationPointAugmentations(SouthboundImpl.java:482)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.SouthboundImpl.getTerminationPointsOfBridge(SouthboundImpl.java:437)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.SecurityServicesImpl.getInterface(SecurityServicesImpl.java:435)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.SecurityServicesImpl.syncSecurityRule(SecurityServicesImpl.java:371)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.PortSecurityHandler.syncSecurityGroup(PortSecurityHandler.java:165)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.PortSecurityHandler.processNeutronSecurityRuleAdded(PortSecurityHandler.java:144)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.PortSecurityHandler.processEvent(PortSecurityHandler.java:130)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:94)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl.access$200(EventDispatcherImpl.java:27)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl$1.run(EventDispatcherImpl.java:56)[267:org.opendaylight.ovsdb.openstack.net-virt:1.2.1.SNAPSHOT]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_45-internal]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_45-internal]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_45-internal]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_45-internal]
>         at java.lang.Thread.run(Thread.java:745)[:1.8.0_45-internal]

Change-Id: I37e0a72c4bc4361b678f748bf1df6c926c101cb1
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/LBaaSPoolMemberHandler.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SecurityGroupCacheManagerImpl.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SecurityServicesImpl.java