You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ud...@apache.org on 2015/04/07 07:06:47 UTC

stratos git commit: fixing IllegalMonitorStateException lock/unlock issue - STRATOS-1316

Repository: stratos
Updated Branches:
  refs/heads/master 53ad7f4b5 -> a539e12bb


fixing IllegalMonitorStateException lock/unlock issue - STRATOS-1316


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

Branch: refs/heads/master
Commit: a539e12bb2d8c6fab4390e978c4d1134f23ff023
Parents: 53ad7f4
Author: Udara Liyanage <ud...@wso2.com>
Authored: Tue Apr 7 10:24:29 2015 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Tue Apr 7 10:36:13 2015 +0530

----------------------------------------------------------------------
 .../cluster/ClusterStatusTerminatedProcessor.java    | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/a539e12b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusTerminatedProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusTerminatedProcessor.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusTerminatedProcessor.java
index a16d833..61d518f 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusTerminatedProcessor.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusTerminatedProcessor.java
@@ -71,13 +71,15 @@ public class ClusterStatusTerminatedProcessor extends ClusterStatusProcessor {
                 getClusterMonitor(clusterId);
         boolean clusterMonitorHasMembers = clusterInstanceHasMembers(monitor, instanceId);
         boolean clusterTerminated = false;
+        String serviceId = monitor.getServiceId();
+
         try {
-            TopologyManager.acquireReadLockForCluster(monitor.getServiceId(), monitor.getClusterId());
-            Service service = TopologyManager.getTopology().getService(monitor.getServiceId());
+            TopologyManager.acquireReadLockForCluster(serviceId, clusterId);
+            Service service = TopologyManager.getTopology().getService(serviceId);
             Cluster cluster;
             String appId = monitor.getAppId();
             if (service != null) {
-                cluster = service.getCluster(monitor.getClusterId());
+                cluster = service.getCluster(clusterId);
                 if (cluster != null) {
                     try {
                         ApplicationHolder.acquireReadLock();
@@ -90,8 +92,8 @@ public class ClusterStatusTerminatedProcessor extends ClusterStatusProcessor {
                                 log.info("Publishing Cluster terminated event for [application]: " + appId +
                                         " [cluster]: " + clusterId);
                             }
-                            ClusterStatusEventPublisher.sendClusterTerminatedEvent(appId, monitor.getServiceId(),
-                                    monitor.getClusterId(), instanceId);
+                            ClusterStatusEventPublisher.sendClusterStatusTerminatedEvent(appId, serviceId,
+                                    clusterId, instanceId);
                             clusterTerminated = true;
 
                         } else {
@@ -104,8 +106,7 @@ public class ClusterStatusTerminatedProcessor extends ClusterStatusProcessor {
                 }
             }
         } finally {
-            TopologyManager.releaseReadLockForCluster(monitor.getServiceId(), monitor.getClusterId());
-
+            TopologyManager.releaseReadLockForCluster(serviceId, clusterId);
         }
         return clusterTerminated;
     }