Add delay for EOR in BGP 91/71391/11
authorLoshmitha <loshmitha@ericsson.com>
Thu, 26 Apr 2018 09:25:06 +0000 (14:55 +0530)
committerSam Hague <shague@redhat.com>
Sat, 16 Jun 2018 17:23:04 +0000 (17:23 +0000)
Adding a delay option to wait for an EOR trigger from ODL

JIRA: NETVIRT-1231
Change-Id: Iac3ddfcdb04d722c005b2286fa450877e6877215
Signed-off-by: Loshmitha <loshmitha@ericsson.com>
Signed-off-by: Sam Hague <shague@redhat.com>
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java

index ac910fd02addf41fd04388d504a9e0858932d843..a971b14aa5892ed1c640fb7d4d16d86609d37043 100755 (executable)
@@ -155,6 +155,8 @@ public class BgpConfigurationManager {
     private static final int DS_RETRY_COUNT = 100; //100 retries, each after WAIT_TIME_BETWEEN_EACH_TRY_MILLIS seconds
     private static final long WAIT_TIME_BETWEEN_EACH_TRY_MILLIS = 1000L; //one second sleep after every retry
     private static final String BGP_ENTITY_TYPE_FOR_OWNERSHIP = "bgp";
+    private static final String BGP_EOR_DELAY = "vpnservice.bgp.eordelay";
+    private static final String DEF_BGP_EOR_DELAY = "1800";
     private static final String BGP_ENTITY_NAME = "bgp";
     private static final String ADD_WARN = "Config store updated; undo with Delete if needed.";
     private static final String DEL_WARN = "Config store updated; undo with Add if needed.";
@@ -180,6 +182,7 @@ public class BgpConfigurationManager {
     private final BgpRouter bgpRouter;
     private final BgpSyncHandle bgpSyncHandle = new BgpSyncHandle();
     private volatile BgpThriftService bgpThriftService = null;
+    private final int delayEorSeconds;
 
     private final CountDownLatch initer = new CountDownLatch(1);
 
@@ -248,6 +251,7 @@ public class BgpConfigurationManager {
         VtyshCli.setHostAddr(hostStartup);
         ClearBgpCli.setHostAddr(hostStartup);
         bgpRouter = BgpRouter.newInstance(this::getConfig, this::isBGPEntityOwner);
+        delayEorSeconds = Integer.parseInt(getProperty(BGP_EOR_DELAY, DEF_BGP_EOR_DELAY));
         registerCallbacks();
 
         entityOwnershipUtils = new EntityOwnershipUtils(entityOwnershipService);
@@ -2184,11 +2188,11 @@ public class BgpConfigurationManager {
          * commenting this due to a bug with QBGP. Will uncomment once QBGP fix is done.
          * This wont have any functional impacts
          */
-        //try {
-        //    br.delayEOR(delayEorSeconds);
-        //} catch (TException | BgpRouterException e) {
-        //    LOG.error("Replay: delayEOR() number of seconds to wait for EOR from ODL:", e);
-        //}
+        try {
+            br.delayEOR(delayEorSeconds);
+        } catch (TException | BgpRouterException e) {
+            LOG.error("Replay: delayEOR() number of seconds to wait for EOR from ODL:", e);
+        }
 
         List<Neighbors> neighbors = config.getNeighbors();
         if (neighbors != null) {