-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
tokio_postgres client query awaits forever #924
Comments
Some questions/comments:
|
|
I set up a new, public accessible DB with as close to the same settings as possible, so I could perform a network capture. |
It looks like the request is never sent to the server. Can you provide a complete, self contained crate that produces that behavior? |
Hi! Were you able to find a solution to this? |
Hey, I was just going through the same problem, but in my case, my issue was that I was inserting some rows before querying, but didn't call Something like this: let writer = BinaryCopyInWriter::new(sink, types);
for (a,b,c,d) in data.iter() {
writer.as_mut().write(&[&a,&b,&c,&d]).await?;
}
// <-- Should've called writer.finish().await?; here
let rows = client.query("SELECT * FROM test;", &[]).await?;
for row in rows {
println!("{:?}", row);
} Not sure what are the inner workings behind this but calling finish solved my issue. Maybe you have another transaction pending and need to finish it before running query. |
Hi, I have faced the same error and after a lot of time I found out what was happening.
Maybe this should be documented also on the connect method because it does tell nothing about the connection struct and it is easy to forget about it. |
My first try with this library and although I can establish a connection with the DB running a query always locks up my lambda until the 10 minute timer runs out.
Last output is "query sent", client.is_closed() returns false, making the user/pw wrong results in a connection error instead as expected.
I tried different queries and different functions (query_one, query_raw, etc.).
The code runs in a AWS lambda and connects to a serverless Aurora Postgresql DB inside a VPC.
Is there any additional debugging I can do to find the root cause?
src/main.rs
Cargo.toml
The text was updated successfully, but these errors were encountered: