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

fix(iroh-net): race ipv4 and ipv6 dns resolution #2026

Merged
merged 3 commits into from
Feb 15, 2024
Merged

Conversation

dignifiedquire
Copy link
Contributor

This now races the resolution, with a fixed timeout on each, returning as many results as found during that time.

Ref #2006

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

I think this is a reasonable tradeoff and a quick improvement.

I guess the right thing is to rework reportgen so that it can start probe sets as soon as a result is returned and return a stream of results. But let's do the simple thing first.


let resolver = AsyncResolver::tokio(config, options);
Ok(resolver)
}

/// Resolve IPv4 and IPv6 in parallel
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably elaborate a little why we don't use the Ipv4AndIpv6 strategy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added some details

.collect();
Ok(res)
}
(Ok(Ok(ipv4)), Err(_err)) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(Ok(Ok(ipv4)), Err(_err)) => {
(Ok(Ok(ipv4)), Err(_timeout)) => {

is perhaps a little bit more readable?
(in all places were a timeout err is matched)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

This now races the resolution, with a fixed timeout on each, returning as many results as found during that time.

Ref #2006
@dignifiedquire dignifiedquire added this pull request to the merge queue Feb 15, 2024
Merged via the queue into main with commit 19553ed Feb 15, 2024
19 checks passed
@dignifiedquire dignifiedquire deleted the fix-ipv6-dns branch February 15, 2024 21:29
fubuloubu pushed a commit to ApeWorX/iroh that referenced this pull request Feb 21, 2024
This now races the resolution, with a fixed timeout on each, returning
as many results as found during that time.

Ref n0-computer#2006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants