[GH-ISSUE #3304] Support smol runtime in the resolver #1166

Open
opened 2026-03-16 01:47:25 +03:00 by kerem · 3 comments
Owner

Originally created by @CathalMullan on GitHub (Oct 10, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3304

Is your feature request related to a problem? Please describe.
I'd like the ability to use the resolver crate with smol instead of tokio.

Describe the solution you'd like
The easiest solution would be to copy the approach previously used by the async-std integration, but for smol.

Describe alternatives you've considered
Alternatively, this might be a good time to make the proto and resolver crates truly runtime agnostic. Though that would be much more work.

From a quick proof of concept, that would require extending the RuntimeProvider trait to handle TCP and TLS connections, and the Spawn trait to replace some freestanding tokio::spawn usages in proto. Then the majority of remaining changes would involve weaving the P: RuntimeProvider throughout the rest of the codebase.

Additional context
The resolver previously supported async-std, but that was ripped out in #2867 due to its discontinuation.

Originally created by @CathalMullan on GitHub (Oct 10, 2025). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3304 **Is your feature request related to a problem? Please describe.** I'd like the ability to use the resolver crate with `smol` instead of `tokio`. **Describe the solution you'd like** The easiest solution would be to copy the approach previously used by the `async-std` integration, but for `smol`. **Describe alternatives you've considered** Alternatively, this might be a good time to make the `proto` and `resolver` crates truly runtime agnostic. Though that would be much more work. From a quick proof of concept, that would require extending the `RuntimeProvider` trait to handle TCP and TLS connections, and the `Spawn` trait to replace some freestanding `tokio::spawn` usages in `proto`. Then the majority of remaining changes would involve weaving the `P: RuntimeProvider` throughout the rest of the codebase. **Additional context** The resolver previously supported `async-std`, but that was ripped out in #2867 due to its discontinuation.
Author
Owner

@djc commented on GitHub (Oct 10, 2025):

I'm leaning towards having any smol-based RuntimeProvider live outside of this repo, in a separate crate probably not maintained by us.

Not sure what you mean by "truly agnostic" but I'm open to reviewing incremental changes that make our library crates more generic by replacing Tokio-specific code with RuntimeProvider-based API.

<!-- gh-comment-id:3391227273 --> @djc commented on GitHub (Oct 10, 2025): I'm leaning towards having any smol-based `RuntimeProvider` live outside of this repo, in a separate crate probably not maintained by us. Not sure what you mean by "truly agnostic" but I'm open to reviewing incremental changes that make our library crates more generic by replacing Tokio-specific code with `RuntimeProvider`-based API.
Author
Owner

@CathalMullan commented on GitHub (Oct 10, 2025):

By truly agnostic, I mean agnostic across all protocols/features.

Looking at the tokio::spawn usages in the h2/h3 stream code, I don't think the old async-std feature was actually free of tokio runtime code.

github.com/hickory-dns/hickory-dns@50f4a1e245/crates/proto/src/h2/h2_client_stream.rs (L533-L537)

github.com/hickory-dns/hickory-dns@50f4a1e245/crates/proto/src/h3/h3_client_stream.rs (L433-L445)

<!-- gh-comment-id:3391276334 --> @CathalMullan commented on GitHub (Oct 10, 2025): By truly agnostic, I mean agnostic across all protocols/features. Looking at the `tokio::spawn` usages in the h2/h3 stream code, I don't think the old `async-std` feature was actually free of `tokio` runtime code. https://github.com/hickory-dns/hickory-dns/blob/50f4a1e24584c9cdb94a880968a39957dd8beaeb/crates/proto/src/h2/h2_client_stream.rs#L533-L537 https://github.com/hickory-dns/hickory-dns/blob/50f4a1e24584c9cdb94a880968a39957dd8beaeb/crates/proto/src/h3/h3_client_stream.rs#L433-L445
Author
Owner

@djc commented on GitHub (Oct 10, 2025):

By truly agnostic, I mean agnostic across all protocols/features.

Looking at the tokio::spawn usages in the h2/h3 stream code, I don't think the old async-std feature was actually free of tokio runtime code.

Fair -- though I think we just disabled these protocols when the tokio feature was disabled?

<!-- gh-comment-id:3391314674 --> @djc commented on GitHub (Oct 10, 2025): > By truly agnostic, I mean agnostic across all protocols/features. > > Looking at the `tokio::spawn` usages in the h2/h3 stream code, I don't think the old `async-std` feature was actually free of `tokio` runtime code. Fair -- though I think we just disabled these protocols when the tokio feature was disabled?
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#1166
No description provided.