Committed by
Yuta Higuchi
Foo: Do not dump DatabaseException backtrace
Change-Id: I43e538cfcedc0c9f6f51fd6d7ccb2509f6723f0f
Showing
1 changed file
with
6 additions
and
3 deletions
... | @@ -44,6 +44,7 @@ import org.onlab.onos.net.intent.IntentEvent; | ... | @@ -44,6 +44,7 @@ import org.onlab.onos.net.intent.IntentEvent; |
44 | import org.onlab.onos.net.intent.IntentListener; | 44 | import org.onlab.onos.net.intent.IntentListener; |
45 | import org.onlab.onos.net.intent.IntentService; | 45 | import org.onlab.onos.net.intent.IntentService; |
46 | import org.onlab.onos.store.service.DatabaseAdminService; | 46 | import org.onlab.onos.store.service.DatabaseAdminService; |
47 | +import org.onlab.onos.store.service.DatabaseException; | ||
47 | import org.onlab.onos.store.service.DatabaseService; | 48 | import org.onlab.onos.store.service.DatabaseService; |
48 | import org.onlab.onos.store.service.Lock; | 49 | import org.onlab.onos.store.service.Lock; |
49 | import org.onlab.onos.store.service.LockService; | 50 | import org.onlab.onos.store.service.LockService; |
... | @@ -209,7 +210,7 @@ public class FooComponent { | ... | @@ -209,7 +210,7 @@ public class FooComponent { |
209 | } | 210 | } |
210 | } | 211 | } |
211 | } | 212 | } |
212 | - int retry = 5; | 213 | + int retry = 1; |
213 | 214 | ||
214 | do { | 215 | do { |
215 | if (vv == null) { | 216 | if (vv == null) { |
... | @@ -223,13 +224,15 @@ public class FooComponent { | ... | @@ -223,13 +224,15 @@ public class FooComponent { |
223 | log.info("Write success. New value: {}", next); | 224 | log.info("Write success. New value: {}", next); |
224 | break; | 225 | break; |
225 | } else { | 226 | } else { |
226 | - log.info("Write failed trying to write {}", next); | 227 | + log.info("Write failed retrying.....{}", retry); |
227 | vv = dbService.get(someTable, someKey); | 228 | vv = dbService.get(someTable, someKey); |
228 | if (vv == null) { | 229 | if (vv == null) { |
229 | log.error("Shouldn't reach here"); | 230 | log.error("Shouldn't reach here"); |
230 | } | 231 | } |
231 | } | 232 | } |
232 | - } while (retry-- > 0); | 233 | + } while (retry++ < 5); |
234 | + } catch (DatabaseException e) { | ||
235 | + log.debug("DB Exception thrown {}", e.getMessage()); | ||
233 | } catch (Exception e) { | 236 | } catch (Exception e) { |
234 | log.error("Exception thrown", e); | 237 | log.error("Exception thrown", e); |
235 | } | 238 | } | ... | ... |
-
Please register or login to post a comment