You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2014/10/22 13:55:59 UTC
git commit: adding a null check and disposing
terminateALlKnowledgeSession in AbstractClusterMonitor
Repository: stratos
Updated Branches:
refs/heads/4.0.0-grouping d5d98d4ef -> 6435221ff
adding a null check and disposing terminateALlKnowledgeSession in AbstractClusterMonitor
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/6435221f
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6435221f
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6435221f
Branch: refs/heads/4.0.0-grouping
Commit: 6435221ff9e836f6dd2ab115ae1e3545da2de0fc
Parents: d5d98d4
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Wed Oct 22 17:25:39 2014 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Wed Oct 22 17:25:39 2014 +0530
----------------------------------------------------------------------
.../topology/AutoscalerTopologyEventReceiver.java | 10 +++++++---
.../autoscaler/monitor/AbstractClusterMonitor.java | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/6435221f/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
index 44059ed..2f31d1b 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/message/receiver/topology/AutoscalerTopologyEventReceiver.java
@@ -276,9 +276,13 @@ public class AutoscalerTopologyEventReceiver implements Runnable {
//stopping the cluster monitor and remove it from the AS
ClusterMonitor clusterMonitor =
((ClusterMonitor) AutoscalerContext.getInstance().getMonitor(clusterId));
- clusterMonitor.setDestroyed(true);
- clusterMonitor.setStatus(ClusterStatus.Terminating);
- clusterMonitor.terminateAllMembers();
+ if (clusterMonitor != null) {
+ clusterMonitor.setDestroyed(true);
+ clusterMonitor.setStatus(ClusterStatus.Terminating);
+ clusterMonitor.terminateAllMembers();
+ } else {
+ log.warn("No Cluster Monitor found for cluster id " + clusterId);
+ }
}
} else {
http://git-wip-us.apache.org/repos/asf/stratos/blob/6435221f/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
index 8ff4cac..3993683 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/monitor/AbstractClusterMonitor.java
@@ -120,6 +120,7 @@ abstract public class AbstractClusterMonitor extends Monitor implements Runnable
public void destroy() {
minCheckKnowledgeSession.dispose();
scaleCheckKnowledgeSession.dispose();
+ terminateAllKnowledgeSession.dispose();
terminateDependencyKnowledgeSession.dispose();
setDestroyed(true);
if (log.isDebugEnabled()) {