cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [15/20] git commit: updated refs/heads/4.3 to 67df5b9
Date Tue, 25 Nov 2014 19:05:11 GMT
CLOUDSTACK-6374: Remove entries from lb vm map when lb rule apply fails

(cherry picked from commit 16ab5ce76c68c2a6c813daec9cd2c90d4c5eb8c6)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java


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

Branch: refs/heads/4.3
Commit: 473cd6f09aad812d8fe61bcb8ad1d3571e5eb50b
Parents: 7b7eb48
Author: Kishan Kavala <kishan@cloud.com>
Authored: Thu Apr 10 14:41:52 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Nov 25 23:19:14 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/473cd6f0/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 cdb38f0..6bc2da5 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -1061,7 +1061,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
@@ -1078,17 +1081,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