-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WIP pool changes #3582
base: main
Are you sure you want to change the base?
WIP pool changes #3582
Conversation
/// `set_connect_options` and `get_connect_options` were removed in 0.9.0 because they complicated | ||
/// the pool internals. They can be reimplemented by capturing a mutex, or similar, in the callback. | ||
/// | ||
/// This example uses Postgres and [`tokio::sync::Mutex`] but may be adapted to any driver |
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.
Just noticed I actually use RwLock
in the example.
} | ||
|
||
#[cfg(not(feature = "_rt-async-std"))] | ||
missing_rt((duration, f)) |
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.
When playing around with this PR locally (to see if it fixes an acquire timeout issue, which it unfortunately doesn't), I found that this caused a compile error. I think it should be
missing_rt((duration, f)) | |
missing_rt((deadline, f)) |
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.
@jplatte if you have a solid repro for acquire timeouts, I'd love to add it as a test here.
acquire()
call is cancelled.acquire()
should now be completely cancel-safe.PoolConnector
trait superceding bothbefore_connect
(requested but not yet implemented) andafter_connect
callbacks.Future
, albeit with a'static
requirement for the returnedFuture
(instead ofBoxFuture
).usize
for all connection counts to get rid of weird inconsistencies.Breaking Changes
Pool::set_connect_options()
andget_connect_options()
have been removed. Instead, implement the newPoolConnector
trait (or use a closure) using something likeArc<RwLock<impl ConnectOptions>>
.PoolOptions::after_connect()
has been removed. Instead, implementPoolConnector
(or use a closure), open a connection and then apply any operations necessary.PoolOptions::min_connections()
,PoolOptions::max_connections()
andPool::size()
now useusize
instead ofu32
.Fixes #3513
Fixes #3315
Fixes #3132
Fixes #3117
Fixes #2848