Fixing STRATOS-378

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

Branch: refs/heads/master
Commit: 9f59b3208215f503d27d92f28d8a6718ab7b0c99
Parents: dc3ae37
Author: Melan Nimesh <[email protected]>
Authored: Mon Jan 27 10:48:48 2014 +0530
Committer: Melan Nimesh <[email protected]>
Committed: Mon Jan 27 10:48:48 2014 +0530

----------------------------------------------------------------------
 .../load/balancer/mediators/ResponseInterceptor.java      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9f59b320/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/ResponseInterceptor.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/ResponseInterceptor.java
 
b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/ResponseInterceptor.java
index e350840..7ca6c8d 100644
--- 
a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/ResponseInterceptor.java
+++ 
b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/mediators/ResponseInterceptor.java
@@ -37,10 +37,14 @@ public class ResponseInterceptor extends AbstractMediator 
implements ManagedLife
                 log.debug("Response interceptor mediation started");
             }
             String clusterId = (String) 
messageContext.getProperty(Constants.CLUSTER_ID);
-            if (StringUtils.isBlank(clusterId)) {
-                throw new RuntimeException("Cluster id not found in message 
context");
+            if (StringUtils.isNotBlank(clusterId)) {
+               
LoadBalancerStatisticsCollector.getInstance().removeAnInFlightRequest(clusterId);
+            } else{
+               if (log.isDebugEnabled()) {
+                    log.debug("Could not decrement in-flight request count : 
cluster id not found in message context");
+                }
             }
-            
LoadBalancerStatisticsCollector.getInstance().removeAnInFlightRequest(clusterId);
+            
         } catch (Exception e) {
             if(log.isErrorEnabled()) {
                 log.error("Could not decrement in-flight request count", e);

Reply via email to