Trim now implements periodic reserve creation / maintains free list. - #158
Merged
Conversation
rob-bygrave
commented
Aug 19, 2026
Collaborator
- Periodic trim now maintains at least minConnections free connections, even when no idle connections were trimmed.
- Reserve capacity is tracked with creatingConnections to respect maxConnections.
- Physical reserve connections are created outside the queue lock, then safely published or closed.
- On-demand growth accounts for in-progress reserve creation.
- Periodic trim now maintains at least minConnections free connections, even when no idle connections were trimmed. - Reserve capacity is tracked with creatingConnections to respect maxConnections. - Physical reserve connections are created outside the queue lock, then safely published or closed. - On-demand growth accounts for in-progress reserve creation.
…() and shutdown()
Reserve capacity under the lock, then create physical connections outside it so concurrent acquire requests can grow the pool in parallel during traffic bursts.
Collaborator
Author
|
Hi @rPraml - this change could result in an increase in pool size in general as it looks to actively maintain minConnections in the freeList. Also the connection creation changes to mostly occur outside of the pool lock. If you get time, please have a good review of the changes here. Thanks. I'll merge it in and look to confirm this handles bursty load better than prior behaviour. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.