DatabaseManager: move retry timeout out from finally clause
Change-Id: If4760bdaa8ac64d5db80c7b6700d75a89099f179
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java b/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
index b3fdfa8..f3cc515 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java
@@ -264,13 +264,12 @@
} catch (DatabaseException e) {
log.debug("Failed to listTables. Will retry later...", e);
Thread.sleep(RETRY_MS);
- } finally {
- if (retries == ACTIVATE_MAX_RETRIES) {
- log.error("Failed to listTables after multiple attempts. Giving up.");
- // Exiting hoping things will be fixed by the time
- // others start using the service
- return;
- }
+ }
+ if (retries == ACTIVATE_MAX_RETRIES) {
+ log.error("Failed to listTables after multiple attempts. Giving up.");
+ // Exiting hoping things will be fixed by the time
+ // others start using the service
+ return;
}
retries++;
} while (true);