Runtime exception handling in addNewAdjToVpnInterface method 23/83223/14
authorAmitesh Soni <amitesh.soni@ericsson.com>
Fri, 26 Jul 2019 07:35:15 +0000 (13:05 +0530)
committerAmitesh Soni <amitesh.soni@ericsson.com>
Mon, 2 Dec 2019 10:22:37 +0000 (15:52 +0530)
Added try-catch block for runtime exception handling for
addNewAdjToVpnInterface in VpnInterfaceManager.java

Also, corrected the minor spelling mistake in a log statement
in getVpnInterfaceOpDataEntryAdjacencyIdentifier in VpnUtil.java

Change-Id: Iefa48b245fc38730a3e1535d1e9adb2d3ab870cb
Signed-off-by: Amitesh Soni <amitesh.soni@ericsson.com>
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnUtil.java

index b9e38a564c6fb922c63f9866249f5159724275aa..88e600b0ce6eb75df107ac2213ab6a2b274bff48 100755 (executable)
@@ -1768,6 +1768,8 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
         }
     }
 
+    // TODO Clean up the exception handling
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private List<ListenableFuture<Void>> updateVpnInstanceAdjChange(VpnInterface original, VpnInterface update,
                                                                     String vpnInterfaceName,
                                                                     List<ListenableFuture<Void>> futures) {
@@ -1807,8 +1809,13 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
                                     } else {
                                         // add new adjacency
                                         if (!isBgpVpnInternetVpn || vpnUtil.isAdjacencyEligibleToVpnInternet(adj)) {
-                                            addNewAdjToVpnInterface(vpnInterfaceOpIdentifier, primaryRd, adj,
+                                            try {
+                                                addNewAdjToVpnInterface(vpnInterfaceOpIdentifier, primaryRd, adj,
                                                     dpnId, operTx, confTx, confTx, prefixListForRefreshFib);
+                                            } catch (RuntimeException e) {
+                                                LOG.error("Failed to add adjacency {} to vpn interface {} with"
+                                                        + " dpnId {}", adj, vpnInterfaceName, dpnId, e);
+                                            }
                                         }
                                         LOG.info("update: new Adjacency {} with nextHop {} label {} subnet {} "
                                             + " added to vpn interface {} on vpn {} dpnId {}",
index 492218577b304cbd86ee9702b7b983c03807a32e..dab5ba3e17ccff86071dcd651e4d223943e49a2b 100644 (file)
@@ -1583,7 +1583,7 @@ public final class VpnUtil {
     static InstanceIdentifier<Adjacency> getVpnInterfaceOpDataEntryAdjacencyIdentifier(String intfName,
                                                                                        String vpnName,
                                                                                        String ipAddress) {
-        LOG.debug("getVpnInterfaceO pDataEntryAdjacencyIdentifier intfName {}, vpnName {}, ipAddress {}",
+        LOG.debug("getVpnInterfaceOpDataEntryAdjacencyIdentifier intfName {}, vpnName {}, ipAddress {}",
                 intfName, vpnName, ipAddress);
         return InstanceIdentifier.builder(VpnInterfaceOpData.class)
                     .child(VpnInterfaceOpDataEntry.class, new VpnInterfaceOpDataEntryKey(intfName, vpnName))