Skip to content
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

Force Cloudflare DNS with MongoDB connections on Windows #2694

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

pimeys
Copy link
Contributor

@pimeys pimeys commented Feb 15, 2022

Adding a new crate to unify Mongo client creation everywhere in Prisma. Also
gets handy when we need to parse multiple replicas in the string.

On Windows, the trust-dns-resolver is VERY slow if not giving it the DNS server
what to use. We for now solve it by resolving with Cloudflare. We know already
this will break in companies that do not allow resolving outside of the company
DNS, and in countries that are either banned from Cloudflare or do not allow
using their services.

Issue to follow: hickory-dns/hickory-dns#1636

Closes: prisma/prisma#11340

@pimeys pimeys requested a review from a team as a code owner February 15, 2022 17:30
@Jolg42 Jolg42 marked this pull request as draft February 16, 2022 07:44
@pimeys pimeys force-pushed the introspection/windows-resolver-fix branch from b765b29 to de3cd8e Compare February 17, 2022 13:53
@pimeys pimeys added this to the 3.10.0 milestone Feb 17, 2022
@pimeys pimeys marked this pull request as ready for review February 17, 2022 13:54
@pimeys pimeys force-pushed the introspection/windows-resolver-fix branch from de3cd8e to 32a9458 Compare February 17, 2022 14:14
Adding a new crate to unify Mongo client creation everywhere in Prisma. Also
gets handy when we need to parse multiple replicas in the string.

On Windows, the trust-dns-resolver is VERY slow if not giving it the DNS server
what to use. We for now solve it by resolving with Cloudflare. We know already
this will break in companies that do not allow resolving outside of the company
DNS, and in countries that are either banned from Cloudflare or do not allow
using their services.

Issue to follow: hickory-dns/hickory-dns#1636
@pimeys pimeys force-pushed the introspection/windows-resolver-fix branch from 32a9458 to a8c9841 Compare February 17, 2022 14:25
@pimeys pimeys changed the title Force Cloudflare DNS on mongo introspection on Windows Force Cloudflare DNS with MongoDB connections on Windows Feb 17, 2022
Copy link
Contributor

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also relevant: #2695

My only nitpick is that it feels like something we could reexport the mongodb crate from, so we don't need two dependencies for mongo everywhere. I get that it would change the imports so it might be tedious to do now.

@pimeys
Copy link
Contributor Author

pimeys commented Feb 17, 2022

We'll do that eventually. It's a good idea.

@pimeys pimeys merged commit 2152ca3 into main Feb 17, 2022
@pimeys pimeys deleted the introspection/windows-resolver-fix branch February 17, 2022 16:27
@janpio
Copy link
Member

janpio commented Feb 17, 2022

Can you make sure #2695 is expanded to all usages and the now existing conflict is fixed? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MongoDB first request takes ~45s on Windows
3 participants