OFFLOCK removes pool-wide lock contention on the disposal path and isolates contention per route. Under slow closes or multi-route churn it keeps leasing non-blocking via direct handoff; LaxConnPool still serializes on shared structures and stalls while closing. Semantics match ManagedConnPool; it’s opt-in for users to benchmark.
Arturo On Thu, Sep 18, 2025 at 9:26 PM Oleg Kalnichevski <[email protected]> wrote: > > > 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] > >
