diff options
Diffstat (limited to 'framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java')
-rw-r--r-- | framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java b/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java index c332ada5..a38550e4 100644 --- a/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java +++ b/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java @@ -59,7 +59,6 @@ import org.onosproject.store.service.ConsistentMap; import org.onosproject.store.service.Serializer; import org.onosproject.store.service.StorageService; import org.onosproject.store.service.TransactionContext; -import org.onosproject.store.service.TransactionException; import org.onosproject.store.service.TransactionalMap; import org.onosproject.store.service.Versioned; @@ -294,7 +293,7 @@ public class ConsistentLinkResourceStore extends intentAllocs.put(allocations.intentId(), allocations); allocations.links().forEach(link -> allocateLinkResource(tx, link, allocations)); tx.commit(); - } catch (TransactionException | ResourceAllocationException e) { + } catch (ResourceAllocationException e) { log.error("Exception thrown, rolling back", e); tx.abort(); } catch (Exception e) { @@ -407,12 +406,8 @@ public class ConsistentLinkResourceStore extends after.remove(allocations); linkAllocs.replace(linkId, before, after); }); - tx.commit(); - success = true; - } catch (TransactionException e) { - log.debug("Transaction failed, retrying", e); - tx.abort(); - } catch (Exception e) { + success = tx.commit(); + } catch (Exception e) { log.error("Exception thrown during releaseResource {}", allocations, e); tx.abort(); throw e; |