cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [2/3] git commit: updated refs/heads/master to 26746fe
Date Thu, 10 Apr 2014 09:58:25 GMT
CLOUDSTACK-6374: Remove entries from lb vm map when lb rule apply fails


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/16ab5ce7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/16ab5ce7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/16ab5ce7

Branch: refs/heads/master
Commit: 16ab5ce76c68c2a6c813daec9cd2c90d4c5eb8c6
Parents: 85072cb
Author: Kishan Kavala <kishan@cloud.com>
Authored: Thu Apr 10 14:41:52 2014 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Thu Apr 10 14:45:15 2014 +0530

----------------------------------------------------------------------
 .../lb/LoadBalancingRulesManagerImpl.java        | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/16ab5ce7/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index 63912b3..91b6aa4 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1095,7 +1095,10 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase
implements
             applyLoadBalancerConfig(loadBalancerId);
             success = true;
         } catch (ResourceUnavailableException e) {
-            if (isRollBackAllowedForProvider(loadBalancer)) {
+            s_logger.warn("Unable to apply the load balancer config because resource is unavaliable.",
e);
+            success = false;
+        } finally {
+            if (!success) {
                 final List<Long> vmInstanceIds = new ArrayList<Long>();
                 Transaction.execute(new TransactionCallbackNoReturn() {
                     @Override
@@ -1111,16 +1114,14 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase
implements
                 }
                 loadBalancer.setState(backupState);
                 _lbDao.persist(loadBalancer);
+                CloudRuntimeException ex = new CloudRuntimeException("Failed to add specified
loadbalancerruleid for vms "
+                    + instanceIds);
+                ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId");
+                // TBD: Also pack in the instanceIds in the exception using the
+                // right VO object or table name.
+                throw ex;
             }
-            s_logger.warn("Unable to apply the load balancer config because resource is unavaliable.",
e);
-        }
 
-        if (!success) {
-            CloudRuntimeException ex = new CloudRuntimeException("Failed to add specified
loadbalancerruleid for vms " + instanceIds);
-            ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId");
-            // TBD: Also pack in the instanceIds in the exception using the
-            // right VO object or table name.
-            throw ex;
         }
 
         return success;


Mime
View raw message