-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remove
to connection pool Lease
#4681
base: master
Are you sure you want to change the base?
Conversation
it seems that this operation can break pool invariants, e.g if the connection has several leases, when another lease calls |
as I understand you would like to mark a connection as |
This probably should have been a draft because I don't quite understand all the inner workings of the pool slots.
Essentially yes, we need a way to communicate to the pool that the connection should be removed. |
I think then we need a new
It would be called like when a connection is marked as shutdown, the slot.usage can only decrease and when it reaches 0 then it will be simply removed from the pool an then closed, another connection can be created to satisfy the waiters then. |
@vietj @tsegismont I tried to implement this idea as a pre-cursor to maintaining minIdle connections in the pool. Basically,
Then, during pool initialization and during remove, we need to call a method that refreshes the pool with minIdle connections (not part of the gist). If this looks good to you, I can create a PR. Please let me know. https://gist.github.com/chandramouli-r/f8adf3b765919ceb54dea9126a2d97f2 |
@vietj @tsegismont create a draft PR for this: #4736 (the added API can be used in SqlConnectionPool for checking maxLifetime when a connection is returned back to the pool). |
Implements #4680