Skip to content

update dns to std::future#520

Merged
hawkw merged 5 commits intomaster-tokio-0.2from
eliza/0.2-dns
May 20, 2020
Merged

update dns to std::future#520
hawkw merged 5 commits intomaster-tokio-0.2from
eliza/0.2-dns

Conversation

@hawkw
Copy link
Contributor

@hawkw hawkw commented May 19, 2020

This branch updates the linkerd2-proxy-dns crate to std::future and
the latest release of trust-dns-resolver, and updates the uses of DNS
in linkerd2-proxy-app to track the changes.

For the most part, this change is pretty straightforward. However, the
std::future version of trust-dns-resolver changed how the background
task driving DNS resolution is executed. Previously, it was returned by
the AsyncResolver constructor, but now, the constructors are async fns that implicitly spawn the background task on the runtime that
executes them.

Therefore, I had to change how the DNS resolver is constructed. I opted
to build the admin runtime early and have it block on the DNS resolver
construction, and then pass that runtime to the admin thread when it is
spawned. This seemed better than making the DNS resolver lazy by making
the underlying trust-dns async resolver an Option or something, and
having it panic when the resolver hasn't been constructed yet. Doing
that safely would have required adding a RwLock or something, which
didn't seem ideal.

@hawkw hawkw requested review from a team and olix0r May 19, 2020 18:38
@hawkw hawkw self-assigned this May 19, 2020
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

lgtm but one suggestion

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw requested a review from a team May 19, 2020 21:41
Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

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

Looks good!

@hawkw hawkw merged commit 5526adb into master-tokio-0.2 May 20, 2020
@olix0r olix0r deleted the eliza/0.2-dns branch May 25, 2021 15:49
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.

3 participants