Skip to content

Notify the callbacks of lease requests failed by StrictConnPool eviction - #735

Merged
arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:pending-requests-callbacks
Nov 2, 2026
Merged

arturobernalg merged 1 commit into
apache:masterfrom
arturobernalg:pending-requests-callbacks

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

StrictConnPool#enumAvailable() and #enumLeased() expire pending lease requests through processPendingRequests() but never fire the completion callbacks. The future of a request that timed out stays uncompleted until the next lease or release, so closeExpired() and closeIdle() do not enforce the lease request timeout on an otherwise idle pool.

Both methods now call fireCallbacks() after releasing the lock, as validatePendingRequests() does.

TestPoolPendingRequestExpiry checks closeExpired() and closeIdle() on all three pools. Only StrictConnPool failed before the change; LaxConnPool and RouteSegmentedConnPool already complete the future of an expired request.

Raised in HTTPCLIENT-2437.

…vailable and #enumLeased

enumAvailable() and enumLeased() expire pending lease requests through
processPendingRequests() but did not fire the completion callbacks. The
futures of requests that timed out stayed uncompleted until the next
lease or release, so closeExpired() and closeIdle() did not enforce the
lease request timeout on an otherwise idle pool.
@arturobernalg
arturobernalg requested a review from ok2c November 2, 2026 19:49
@ok2c

ok2c commented Nov 2, 2026

Copy link
Copy Markdown
Member

@arturobernalg Please cherry-pick to 5.4.x

@arturobernalg
arturobernalg merged commit 9983b03 into apache:master Nov 2, 2026
12 checks passed
@arturobernalg

Copy link
Copy Markdown
Member Author

@ok2c Done: #736 cherry-picks this to 5.4.x. The production change is the same. The test uses the real clock with a 50 ms request timeout, as 5.4.x has no clock injection. The full httpcore5 build on 5.4.x passes (1261 tests).

@arturobernalg

Copy link
Copy Markdown
Member Author

@ok2c Done. Cherry-picked to 5.4.x as 83f4195. The production change is the same; the test uses the real clock, as 5.4.x has no clock injection. The httpcore5 build on 5.4.x passes (1261 tests). #736 is not needed anymore.

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.

2 participants