You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/10/11 06:13:31 UTC

[45/50] [abbrv] git commit: deleting the service if the pods are not created within a period

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/6cc484f4
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6cc484f4
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6cc484f4

Branch: refs/heads/master
Commit: 6cc484f40e4334859dc71cf1618d331049157d1a
Parents: f8353a6
Author: R-Rajkumar <rr...@gmail.com>
Authored: Fri Oct 10 22:52:10 2014 +0530
Committer: Nirmal Fernando <ni...@gmail.com>
Committed: Sat Oct 11 09:30:58 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/6cc484f4/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()) {