Sitelet https://github.com/apache/httpcomponents-core/pull/722
Skip to content

Reclaim idle connections across routes in RouteSegmentedConnPool - #722

Open
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:offlock-cross-route-reclaim
Open

arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:offlock-cross-route-reclaim

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

RouteSegmentedConnPool currently stops allocating when the global limit is reached, even if another route holds an idle reusable entry.

This change allows the pool to reclaim an idle entry from another route and transfer the global allocation slot to the requesting route.

The hot path remains route-local. Cross-route reclamation is only attempted when normal allocation cannot proceed because maxTotal has been reached.

It also ensures pending routes are retried when global capacity becomes available, while avoiding unnecessary drain activity for routes already at their per-route limit.

Benchmarks show no regression on the hot path and improved throughput for the full-pool cross-route case.

@arturobernalg
arturobernalg marked this pull request as draft October 3, 2026 15:45
@arturobernalg
arturobernalg force-pushed the offlock-cross-route-reclaim branch from bc8c1b4 to 715f22a Compare October 3, 2026 17:27
@arturobernalg
arturobernalg marked this pull request as ready for review October 4, 2026 04:40
@arturobernalg
arturobernalg force-pushed the offlock-cross-route-reclaim branch from ca1e57e to 62db52e Compare October 4, 2026 10:09
@arturobernalg
arturobernalg force-pushed the offlock-cross-route-reclaim branch from 9159a06 to bf93e5e Compare October 4, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant