Open option-greek opened 1 year ago
If anyone knows how to use deadpool with sqlx, please provide a sample. The previous example provided here no longer compiles.
Workaround: The problem doesn't happen with max life time of 2 min and idle time out of 1 min. It works reliably with these settings.
I have the same problem. Is that okay?
.idle_timeout(Some(Duration::from_secs(60))) .max_lifetime(Some(Duration::from_secs(120)))
@option-greek
I am currently facing this same issue, I sql queries will randomly error out with PoolTimedOut, and only rarely there would be no error.
Bug Description
PoolTimeOut error happens frequently when the server is idle. If I don't give a gap between requests, the timeout doesn't happen. My guess is when there is a timeout, the pool/its implementation doesn't detect it. Note: I know it's not a DB issue because connecting directly works (and also works after the pool has timed out). Worst part is if I make a second request, it still waits till the first one times out.
Steps: 1) Create a pool and make it do a query when accessed through a tokio thread (could be any web server framework. I'm using warp) 2) Make the first request. It succeeds 3) Keep the server idle for some time (I kept for 1 hour - happens below that too) 4) Make the second request: It times out with pool timeout. While its hanging trying to timeout, any number of parallel requests will also hang. 5) Make the 3rd request after the PoolTimeOut error. It will succeed again.
Minimal Reproduction
This is how I'm initializing the pool.
Info
rustc --version
: rustc 1.62.1 (e092d0b6b 2022-07-16)