-
Notifications
You must be signed in to change notification settings - Fork 173
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
RUST-1712 Provide a connection pool warmup method #932
Conversation
/// | ||
/// Note that topology changes require rebuilding the connection pool, so this method cannot | ||
/// guarantee that the pool will always be filled for the lifetime of the `Client`. | ||
pub async fn warm_connection_pool(&self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to naming suggestions here. "warm" seems a little vague but I couldn't think of a better one that wasn't super verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this seems fine to me. can you note in the comment for this method that nothing will happen if min_pool_size
is 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small comment, no need for re-review!
/// | ||
/// Note that topology changes require rebuilding the connection pool, so this method cannot | ||
/// guarantee that the pool will always be filled for the lifetime of the `Client`. | ||
pub async fn warm_connection_pool(&self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this seems fine to me. can you note in the comment for this method that nothing will happen if min_pool_size
is 0?
RUST-1712
This works by spawning a task that sends check out requests in a loop until the receiving worker reports that the pool has hit
min_pool_size
. This is a little indirect but seems to have the fewest drawbacks compared to other methods I considered: