[GH-ISSUE #1250] Upgrade to tokio v0.3 #633

Closed
opened 2026-03-15 23:33:03 +03:00 by kerem · 12 comments
Owner

Originally created by @zonyitoo on GitHub (Oct 16, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1250

Tokio v0.3 have been released: https://tokio.rs/blog/2020-10-tokio-0-3

Originally created by @zonyitoo on GitHub (Oct 16, 2020). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1250 Tokio v0.3 have been released: https://tokio.rs/blog/2020-10-tokio-0-3
kerem 2026-03-15 23:33:03 +03:00
Author
Owner

@bluejekyll commented on GitHub (Oct 16, 2020):

Not clear what work there is here right now.

<!-- gh-comment-id:709919299 --> @bluejekyll commented on GitHub (Oct 16, 2020): Not clear what work there is here right now.
Author
Owner

@zonyitoo commented on GitHub (Oct 16, 2020):

At lease the following works have to be done: :P

  1. Upgrade tokio version in Cargo.toml
  2. Compatible with the lastest AsyncRead::poll_read
  3. runtime::Handle is no longer public
<!-- gh-comment-id:709923717 --> @zonyitoo commented on GitHub (Oct 16, 2020): At lease the following works have to be done: :P 1. Upgrade tokio version in Cargo.toml 2. Compatible with the lastest `AsyncRead::poll_read` 3. `runtime::Handle` is no longer public
Author
Owner

@djc commented on GitHub (Oct 16, 2020):

For now, this is blocked on new tokio-rustls, tokio-tls and tokio-openssl releases.

<!-- gh-comment-id:709987633 --> @djc commented on GitHub (Oct 16, 2020): For now, this is blocked on new tokio-rustls, tokio-tls and tokio-openssl releases.
Author
Owner

@bluejekyll commented on GitHub (Oct 16, 2020):

Handle is no longer public? Hm. I must have missed that in the Tokio dev messages.

I’m a fan of handle specifically to know when a runtime has actually been instantiated in a typesafe way.

<!-- gh-comment-id:710084946 --> @bluejekyll commented on GitHub (Oct 16, 2020): Handle is no longer public? Hm. I must have missed that in the Tokio dev messages. I’m a fan of handle specifically to know when a runtime has actually been instantiated in a typesafe way.
Author
Owner

@djc commented on GitHub (Oct 17, 2020):

It looks like tokio-tls is no longer being maintained and new development happens in tokio-native-tls (see #1251). It looks like all of tokio-rustls, tokio-native-tls and tokio-openssl now have tokio 0.3-compatible releases.

@bluejekyll can we assume that the next trust-dns release will be tokio 0.3 only?

<!-- gh-comment-id:711023983 --> @djc commented on GitHub (Oct 17, 2020): It looks like tokio-tls is no longer being maintained and new development happens in tokio-native-tls (see #1251). It looks like all of tokio-rustls, tokio-native-tls and tokio-openssl now have tokio 0.3-compatible releases. @bluejekyll can we assume that the next trust-dns release will be tokio 0.3 only?
Author
Owner

@bluejekyll commented on GitHub (Oct 17, 2020):

yes. I think so.

<!-- gh-comment-id:711024185 --> @bluejekyll commented on GitHub (Oct 17, 2020): yes. I think so.
Author
Owner

@zonyitoo commented on GitHub (Nov 3, 2020):

Hello, what's the status of migrating to tokio v0.3? @bluejekyll

<!-- gh-comment-id:721062991 --> @zonyitoo commented on GitHub (Nov 3, 2020): Hello, what's the status of migrating to tokio v0.3? @bluejekyll
Author
Owner

@bluejekyll commented on GitHub (Nov 3, 2020):

#1262 Not looking good right now.

<!-- gh-comment-id:721161084 --> @bluejekyll commented on GitHub (Nov 3, 2020): #1262 Not looking good right now.
Author
Owner

@LEXUGE commented on GitHub (Nov 3, 2020):

Hello, what's the status of migrating to tokio v0.3? @bluejekyll

If you are on hurry of migrating to tokio v0.3, you could probably adopt tokio-compat first. I tested that out and it works fine with trust-dns-resolver.

<!-- gh-comment-id:721175084 --> @LEXUGE commented on GitHub (Nov 3, 2020): > Hello, what's the status of migrating to tokio v0.3? @bluejekyll If you are on hurry of migrating to tokio v0.3, you could probably adopt [tokio-compat](https://docs.rs/tokio-compat-02/0.1.2/tokio_compat_02/) first. I tested that out and it works fine with trust-dns-resolver.
Author
Owner

@bluejekyll commented on GitHub (Nov 3, 2020):

Hello, what's the status of migrating to tokio v0.3? @bluejekyll

If you are on hurry of migrating to tokio v0.3, you could probably adopt tokio-compat first. I tested that out and it works fine with trust-dns-resolver.

Would you mind posting an example?

<!-- gh-comment-id:721215724 --> @bluejekyll commented on GitHub (Nov 3, 2020): > > Hello, what's the status of migrating to tokio v0.3? @bluejekyll > > If you are on hurry of migrating to tokio v0.3, you could probably adopt [tokio-compat](https://docs.rs/tokio-compat-02/0.1.2/tokio_compat_02/) first. I tested that out and it works fine with trust-dns-resolver. Would you mind posting an example?
Author
Owner

@LEXUGE commented on GitHub (Nov 4, 2020):

github.com/LEXUGE/dcompass@4da162b756/dcompass/src/filter.rs (L84)

Like above, add use tokio_compat_02::FutureExt; and use .compat() before .await whenever necessary. That helps me to use tokio v0.3 features with trust-dns v0.19.5.

P.S. unrelated, but I am getting trouble with performance in implementing a DNS "forwarder". It seems like it is underperformed and I doubt whether resolver is the right crate for it because it is too "high-level". Maybe client is the right crate, but it lacks easy-to-spot DoH and DoT features (seems Streams are in separate crates). Is client the right one?

<!-- gh-comment-id:721763274 --> @LEXUGE commented on GitHub (Nov 4, 2020): https://github.com/LEXUGE/dcompass/blob/4da162b756ce11b88ea49ec640cd1e47fc1f282c/dcompass/src/filter.rs#L84 Like above, add `use tokio_compat_02::FutureExt;` and use `.compat()` before `.await` whenever necessary. That helps me to use tokio v0.3 features with trust-dns v0.19.5. P.S. unrelated, but I am getting trouble with performance in implementing a DNS "forwarder". It seems like it is underperformed and I doubt whether resolver is the right crate for it because it is too "high-level". Maybe `client` is the right crate, but it lacks easy-to-spot DoH and DoT features (seems `Stream`s are in separate crates). Is `client` the right one?
Author
Owner

@MikailBag commented on GitHub (Nov 6, 2020):

Let me note that tokio-compat-02 uses single-thread runtime. It means all tasks spawned using tokio 02 APIs will not benefit from multiple CPU cores. Maybe it's the reason of performance problem.

<!-- gh-comment-id:722932721 --> @MikailBag commented on GitHub (Nov 6, 2020): Let me note that tokio-compat-02 uses single-thread runtime. It means all tasks spawned using tokio 02 APIs will not benefit from multiple CPU cores. Maybe it's the reason of performance problem.
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#633
No description provided.