You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2026/09/28 15:25:05 UTC
(httpcomponents-core) branch master updated (5bd5706be -> e91fc9c95)
This is an automated email from the ASF dual-hosted git repository.
ok2c pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
discard 5bd5706be Added H2MultiplexingRequester method to evict expired connections
new e91fc9c95 Added H2MultiplexingRequester method to evict expired connections
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (5bd5706be)
\
N -- N -- N refs/heads/master (e91fc9c95)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(httpcomponents-core) 01/01: Added H2MultiplexingRequester method to evict expired connections
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ok2c pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
commit e91fc9c95c5796eed48e9ad66eff14548a86d236
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Mon Sep 28 16:55:20 2026 +0200
Added H2MultiplexingRequester method to evict expired connections
---
.../http2/impl/nio/bootstrap/H2MultiplexingRequester.java | 15 +++++++++++++--
.../org/apache/hc/core5/http2/nio/pool/H2ConnPool.java | 11 +++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2MultiplexingRequester.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2MultiplexingRequester.java
index daaa00a02..6e35e201b 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2MultiplexingRequester.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/bootstrap/H2MultiplexingRequester.java
@@ -32,9 +32,9 @@
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.atomic.AtomicReference;
import org.apache.hc.core5.annotation.Internal;
import org.apache.hc.core5.concurrent.Cancellable;
@@ -129,13 +129,24 @@ public H2MultiplexingRequester(
*
* @deprecated This method has no effect as of version 5.5 and should not be used.
* Use the connection level socket timeout to ensure idle connections time out
- * and get gracefully terminated.
+ * and get gracefully terminated. Expired connections can be proactively evicted
+ * from the pool with {@link #evictExpired()}.
+ *
+ * @see #evictExpired()
*/
@Deprecated
public void closeIdle(final TimeValue idleTime) {
connPool.closeIdle(idleTime);
}
+ /**
+ * Evict expired (closed) connections.
+ * @since 5.5
+ */
+ public void evictExpired() {
+ connPool.evictExpired();
+ }
+
public Set<HttpHost> getRoutes() {
return connPool.getRoutes();
}
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
index afcfffd3d..fae155bd2 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/nio/pool/H2ConnPool.java
@@ -155,4 +155,15 @@ protected void validateSession(
}
}
+ /**
+ * Evict expired (closed) sessions.
+ * @since 5.5
+ */
+ public void evictExpired() {
+ // This will cause closed sessions to get removed from the pool
+ enumAvailable(e -> {
+ // no op
+ });
+ }
+
}