[GH-ISSUE #650] syncrhonous Resolver should maintain conn pool across uses #262

Closed
opened 2026-03-07 23:06:36 +03:00 by kerem · 4 comments
Owner

Originally created by @bluejekyll on GitHub (Jan 7, 2019).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/650

Is your feature request related to a problem? Please describe.

See comment: https://github.com/bluejekyll/trust-dns/issues/532#issuecomment-451251197 where the usage of the synchronous Resolver is expected to maintain connections across uses.

Describe the solution you'd like

The Global Resolver described in #462 is most-likely the best option. An issue to determine is how to make that programatically configurable.

Describe alternatives you've considered

Another option would be to rely on tokio's background processing, but this needs to be researching.

Additional context

The synchronous Resolver does not hold a reference to a Tokio runtime, to ensure that it itself is Send/Sync, see documentation here: https://docs.rs/trust-dns-resolver/0.10.2/trust_dns_resolver/struct.Resolver.html

Originally created by @bluejekyll on GitHub (Jan 7, 2019). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/650 **Is your feature request related to a problem? Please describe.** See comment: https://github.com/bluejekyll/trust-dns/issues/532#issuecomment-451251197 where the usage of the synchronous Resolver is expected to maintain connections across uses. **Describe the solution you'd like** The Global Resolver described in #462 is most-likely the best option. An issue to determine is how to make that programatically configurable. **Describe alternatives you've considered** Another option would be to rely on tokio's background processing, but this needs to be researching. **Additional context** The synchronous Resolver does not hold a reference to a Tokio runtime, to ensure that it itself is Send/Sync, see documentation here: https://docs.rs/trust-dns-resolver/0.10.2/trust_dns_resolver/struct.Resolver.html
kerem 2026-03-07 23:06:36 +03:00
Author
Owner

@bluejekyll commented on GitHub (Jan 7, 2019):

FYI @juliangehring

<!-- gh-comment-id:451830742 --> @bluejekyll commented on GitHub (Jan 7, 2019): FYI @juliangehring
Author
Owner

@bluejekyll commented on GitHub (Jan 7, 2019):

Hm, When the decision was made to not carry the old Tokio::Core it appeared that there was no way to have a Send+Sync syncronous Resolver. This appears to have changed. As tokio::Runtime now appears to be Send+Sync. This means it's possible for the Resolver to have a Runtime.

This is probably the easiest patch for the issue.

<!-- gh-comment-id:451839261 --> @bluejekyll commented on GitHub (Jan 7, 2019): Hm, When the decision was made to not carry the old `Tokio::Core` it appeared that there was no way to have a `Send+Sync` syncronous Resolver. This appears to have changed. As tokio::Runtime now appears to be `Send+Sync`. This means it's possible for the Resolver to have a Runtime. This is probably the easiest patch for the issue.
Author
Owner

@juliangehring commented on GitHub (Jan 13, 2019):

Thanks, it works very well now!

<!-- gh-comment-id:453841936 --> @juliangehring commented on GitHub (Jan 13, 2019): Thanks, it works very well now!
Author
Owner

@bluejekyll commented on GitHub (Jan 13, 2019):

Thank you for the feedback. It does have a downside of locking between threads on queries, if you share the instance across threads. Just making sure you’re aware of that downside.

<!-- gh-comment-id:453842175 --> @bluejekyll commented on GitHub (Jan 13, 2019): Thank you for the feedback. It does have a downside of locking between threads on queries, if you share the instance across threads. Just making sure you’re aware of that downside.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#262
No description provided.