-
Notifications
You must be signed in to change notification settings - Fork 163
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
Connection delays observed on IPv6-only networks #1170
Comments
Hey @rtbenfield, thank you for this thorough report! I did some investigation and the reasoning behind this IPV4-first approach was for simplicity and consistency with other drivers; however, I agree that it is not the right solution for your network. This seems like a problem best addressed by implementing happy eyeballs instead. I filed RUST-1994 to track this, and the team will discuss prioritization shortly. Feel free to follow that ticket for more updates. |
Thanks for the quick response @isabelatkinson! That sounds like it would be a great solution for our network configuration. |
@rtbenfield We'll be working on this early next month. Please let us know if you have any further questions! |
I believe we have a fix, although it's hard to test since we can't replicate your exact network environment. Do you have a repeatable test you could run using that branch? |
Hi @abr-egn thanks. We will give this a try and come back with feedback. |
Our team put together a Prisma ORM version with this fix integrated and it worked perfectly 🚀 Connections from within the Accelerate network are super fast now. Thanks for addressing this so quickly! |
I'm very glad to hear that 🙂 I've merged that PR in, it'll go live with 3.1.0. |
@abr-egn great news! Can you please share if 3.1.0 is planned for release this week by any chance? Next Prisma ORM release is next week, so we were hoping to include this fix there. No pressure if not! We can always use the branch you provided in the meantime. |
Not this week, I'm afraid. |
Summary
Hi 👋🏻 I work at Prisma on the team that is responsible for Accelerate. We've had reports from users using Accelerate with MongoDB that initial requests take a significant time, often exceeding 10 seconds, when running on Accelerate. Accelerate uses the Prisma ORM to operate its connection pooling, which has a dependency on the MongoDB Rust driver. After some investigation, we believe this is caused by a manual DNS resolution and preference for IPv4 within the driver.
Accelerate operates an IPv6-only network with outbound IPv4 requests routed through a NAT gateway using DNS64. The DNS resolution for these hosts will return both IPv4 and IPv6 addresses, though the network only supports IPv6. This is typically acceptable when establishing connections by hostname as the host will prefer the IPv6 address. Unfortunately, the manual DNS resolution in the driver here is prioritizing the IPv4 first and waits for that attempt to time out before using the DNS64 IPv6 address and succeeding. Additional requests on the established connection work as expected.
mongo-rust-driver/src/runtime/stream.rs
Line 305 in 5bc56ca
Versions/Environment
cargo pkgid mongodb
&cargo pkgid bson
)cargo pkid mongodb
->registry+https://github.com/rust-lang/crates.io-index#mongodb@2.8.0
cargo pkid bson
->registry+https://github.com/rust-lang/crates.io-index#bson@2.8.1
db.version()
)Describe the bug
A clear and concise description of what the bug is.
BE SPECIFIC:
clue in the right direction?
AsyncTcpStream::connect
.server, and/or Rust)?
function produce a crash)?
The text was updated successfully, but these errors were encountered: