Revert Bug 4723 AAA StoreBuilder init times out too early 60/31060/1
authorRyan Goulding <ryandgoulding@gmail.com>
Wed, 9 Dec 2015 11:12:58 +0000 (06:12 -0500)
committerRyan Goulding <ryandgoulding@gmail.com>
Wed, 9 Dec 2015 11:13:58 +0000 (06:13 -0500)
This reverts commit 0f25e8c273c6297e4e88f8e2f335e08d0194c029.

Change-Id: I3d435e45290c3f6ac0c9163ada9130c6210687b0
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
aaa-idmlight/src/main/java/org/opendaylight/aaa/idm/StoreBuilder.java

index 1616865ad0d92101e046da75a82650a760e028d3..cb9649bacf4acc40a6a479066c05521ac4913398 100644 (file)
@@ -25,19 +25,6 @@ import org.slf4j.LoggerFactory;
 
 public class StoreBuilder {
 
-    /*
-     * Wait time between polling for backing data store.
-     */
-    private static final int STOREBUILDER_POLL_INTERVAL = 5000;
-
-    /*
-     * StoreBuilder has to wait for an injected DataStore befor attempting creation.
-     * Due to bundles loading at different times, this is not always deterministic.
-     * If you see the following in karaf.log, consider increasing this constant.
-     * "org.opendaylight.aaa.idmlight - 0.3.0.SNAPSHOT | Store is not available, aborting initialization"
-     */
-    private static final int STOREBUILDER_INIT_TIMEOUT = 600;
-
     private static Logger logger = LoggerFactory.getLogger(StoreBuilder.class);
 
     public static void init() throws IDMStoreException {
@@ -45,10 +32,10 @@ public class StoreBuilder {
         int waitingTime = 5;
 
         while(AAAIDMLightModule.getStore()==null){
-            try{Thread.sleep(STOREBUILDER_POLL_INTERVAL);}catch(Exception err){logger.error("Interrupted",err);}
-            logger.info("No store service is available yet, waiting up to 10 minutes, waited for "+waitingTime+" seconds..");
+            try{Thread.sleep(5000);}catch(Exception err){logger.error("Interrupted",err);}
+            logger.info("No store service is available yet, waiting up to 30 seconds, waited for "+waitingTime+" seconds..");
             waitingTime+=5;
-            if(waitingTime>=STOREBUILDER_INIT_TIMEOUT)
+            if(waitingTime>=30)
                 break;
         }
         if(AAAIDMLightModule.getStore()==null){
@@ -122,4 +109,4 @@ public class StoreBuilder {
         grant.setRoleid(adminRole.getRoleid());
         grant = store.writeGrant(grant);
    }
-}
\ No newline at end of file
+}