-
Notifications
You must be signed in to change notification settings - Fork 169
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
mongo failed with tokio no reactor running since 3.2.0 #1287
Comments
Currently, we can workaround this by exclude # mongodb has known issues on 3.2.0: https://github.com/mongodb/mongo-rust-driver/issues/1287
mongodb = { version = ">=3,<3.2.0", optional = true }
mongodb-internal-macros = { version = ">=3,<3.2.0", optional = true } |
Thanks for the report! I can't reproduce this failure with a simple client binary (below) - can you give me more information about how you're constructing and managing the client, and ideally minimal code for a reproduction? From the error stack, it looks like the issue is happening not when the client is being constructed but when it's being dropped; the client does need to do async work to release server-side resources when it's dropped so the associated tokio runtime needs to outlive the client. (This didn't change between 3.1.x and 3.2.0, so I'm not sure why you'd be getting an error when upgrading.) Test program: #[tokio::main]
async fn main() {
let client = mongodb::Client::with_uri_str("mongodb://localhost:27017")
.await
.unwrap();
let names = client.list_database_names().await.unwrap();
println!("{:?}", names);
}
Output:
|
There has not been any recent activity on this ticket, so we are marking it as stale. If we do not hear anything further from you, this issue will be automatically closed in one week. |
Hi, thanks for the response. I'm in holiday currently. I will provide more details and maybe a reproduction later. |
Versions/Environment
Latest stable rust.
Linux (github action ubuntu 24.04)
cargo pkgid mongodb
&cargo pkgid bson
)3.2.0
db.version()
)No related. (unable to connect since client side panic)
No related. (unable to connect since client side panic)
Describe the bug
It used to work correctly
3.1.1
, but failed since3.2.0
To Reproduce
The text was updated successfully, but these errors were encountered: