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

Reply via email to