Fix Infinite loop in addVpnInterface 65/77765/2
authorVishal Thapar <vthapar@redhat.com>
Wed, 14 Nov 2018 07:28:43 +0000 (12:58 +0530)
committerVishal Thapar <vthapar@redhat.com>
Wed, 14 Nov 2018 10:07:37 +0000 (15:37 +0530)
add VPNInterface logic in VpnInterfaceManager
has a bug where if add VPN Interface fails, it keeps
retrying till it succeeds. There is no delay in retries.
IF there are any DS issues, this results in an infinite
loop which ties up a DJC thread and fills logs with same
msg repeatedly at a near instant rate.

Bug is in logic where onFailure() method adds the failed
interface back to retry. So while DJC does give up after
5 retries, since we've added it back to the queue
subsequent attempts start soon after.

This also fixes a copy-paste log msg which made it
difficult to troubleshoot where the error log
was repeating from.

Change-Id: I97c73dc879aaa4e1a4b3489e146d1a9337b62810
Signed-off-by: Vishal Thapar <vthapar@redhat.com>
vpnmanager/impl/src/main/java/org/opendaylight/netvirt/vpnmanager/VpnInterfaceManager.java

index cd9d2c0b85dfe01504ae34855b387d7da044b173..4c3c4bfb9cb57fe86da92c33ae31c0d26defea99 100755 (executable)
@@ -2135,11 +2135,6 @@ public class VpnInterfaceManager extends AsyncDataTreeChangeListenerBase<VpnInte
     }
 
     private void processSavedInterface(UnprocessedVpnInterfaceData intefaceData, String vpnName) {
-        if (!canHandleNewVpnInterface(intefaceData.identifier, intefaceData.vpnInterface, vpnName)) {
-            LOG.error("add: VpnInstance {} for vpnInterface {} not ready, holding on ",
-                  vpnName, intefaceData.vpnInterface.getName());
-            return;
-        }
         final VpnInterfaceKey key = intefaceData.identifier.firstKeyOf(VpnInterface.class);
         final String interfaceName = key.getName();
         InstanceIdentifier<VpnInterfaceOpDataEntry> vpnInterfaceOpIdentifier = VpnUtil