On 9/18/2025 8:14 PM, Arturo Bernal wrote:
Hi all,
To improve connection pool performance under high concurrency, I propose
adding a new experimental lock-free pool implementation,
RouteSegmentedConnPool, to HttpCore 5.4.
*Overview*
RouteSegmentedConnPool implements ManagedConnPool and introduces a new
PoolConcurrencyPolicy.OFFLOCK. Its design:
-
Per-route segmentation (ConcurrentHashMap + ConcurrentLinkedDeque) to
avoid global locks.
-
Direct handoff to compatible waiters; otherwise reuse follows LIFO/FIFO
policy.
-
Disposal handled off-lock via pluggable DisposalCallback to ensure slow
closes don’t block unrelated routes.
-
Preserves existing STRICT and LAX semantics; OFFLOCK is opt-in.
*API / Compatibility*
-
New PoolConcurrencyPolicy.OFFLOCK.
-
PoolingHttpClientConnectionManager instantiates RouteSegmentedConnPool
when OFFLOCK is selected.
-
No changes to existing defaults; backward compatibility is preserved.
The intent is to ship this as @Experimental in 5.4 so users can benchmark
and provide feedback.
Thoughts?
Arturo
Arturo
No one can stop you from contributing new features as long as you are
willing to support them.
In this very instance, however, how would this new pool implementation
be better than LaxConnPool?
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]