You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2014/10/10 19:22:28 UTC

git commit: deleting the service if the pods are not created within a period

Repository: stratos
Updated Branches:
  refs/heads/container-autoscaling f52d22a2e -> b11faf4e9


deleting the service if the pods are not created within a period


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

Branch: refs/heads/container-autoscaling
Commit: b11faf4e9accc7c98634502983ebbf9403bdbc4b
Parents: f52d22a
Author: R-Rajkumar <rr...@gmail.com>
Authored: Fri Oct 10 22:52:10 2014 +0530
Committer: R-Rajkumar <rr...@gmail.com>
Committed: Fri Oct 10 22:52:10 2014 +0530

----------------------------------------------------------------------
 .../cloud/controller/impl/CloudControllerServiceImpl.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b11faf4e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
index 5194a76..a9a72cb 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
@@ -1426,8 +1426,16 @@ public class CloudControllerServiceImpl implements CloudControllerService {
 			    if(newlyCreatedPods.length == expectedCount) {
 			        break;
 			    }
-			    Thread.sleep(5000);
+			    Thread.sleep(10000);
             }
+
+			if (newlyCreatedPods.length == 0) {
+				if (LOG.isDebugEnabled()) {
+					LOG.debug(String.format("Pods are not created for cluster : %s, hence deleting the service", clusterId));
+				}
+				terminateAllContainers(clusterId);
+				return new MemberContext[0];
+			}
 			
 			if (LOG.isDebugEnabled()) {