hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [08/50] httpcomponents-core git commit: HTTPCORE-429: NIO connection pool incorrectly reports the number of pending connections per individual route
Date Tue, 09 May 2017 20:01:34 GMT
HTTPCORE-429: NIO connection pool incorrectly reports the number of pending connections per
individual route

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.4.x@1772395
13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/4.4.x
Commit: d550a5edcd7c8717cc7f0e2ddeb04a9c2742cfd3
Parents: 141eacd
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Fri Dec 2 18:53:51 2016 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Fri Dec 2 18:53:51 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/http/nio/pool/AbstractNIOConnPool.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/d550a5ed/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
index 02533ba..b4ee96d 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
@@ -59,6 +59,7 @@ import org.apache.http.pool.PoolEntryCallback;
 import org.apache.http.pool.PoolStats;
 import org.apache.http.util.Args;
 import org.apache.http.util.Asserts;
+import org.apache.http.util.LangUtils;
 
 /**
  * Abstract non-blocking connection pool.
@@ -682,9 +683,15 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T,
C>>
         this.lock.lock();
         try {
             final RouteSpecificPool<T, C, E> pool = getPool(route);
+            int pendingCount = 0;
+            for (LeaseRequest<T, C, E> request: leasingRequests) {
+                if (LangUtils.equals(route, request.getRoute())) {
+                    pendingCount++;
+                }
+            }
             return new PoolStats(
                     pool.getLeasedCount(),
-                    pool.getPendingCount(),
+                    pendingCount + pool.getPendingCount(),
                     pool.getAvailableCount(),
                     getMax(route));
         } finally {


Mime
View raw message