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

Parallel queries for IPv4 and IPv6 should be done by mdns_minimal #83

Open
pemensik opened this issue Dec 6, 2022 · 1 comment
Open

Comments

@pemensik
Copy link
Member

pemensik commented Dec 6, 2022

Just checked how long it takes to resolve nx.local, where that host does not exist on the network. I think the problem lies in do_avahi_resolve_name() function in nss.c, which converts AF_UNSPEC to sequential IPv4, then IPv6 resolution separately. I think we need a way to request both at the same time. Let avahi resolve them in parallel and return both. Because it is serializing addresses to text records, it should be handled fine even when mixed addresses in single response.

When I have mdns_minimal nss plugin used, the query time getent ahosts nx.local takes 10s on my Fedora. It takes even more on OpenSUSE for some reason. I think even 5s is too much in general, which it takes when mdns4_minimal is used.

I think Avahi should be smart enough and speed up response time in case only one of address families returns an address. The other family might not be used, but it should not wait for long time to ensure that.

@pemensik
Copy link
Member Author

pemensik commented Dec 6, 2022

I think we want the plugin to forward AF_UNSPEC family queries to the avahi-daemon over the socket. Now it starts separate queries with RESOLVE-NAME-IPV{4,6}, but they are made sequentially. That has unfortunate result that it doubles timeout for any used name. If we forward it to avahi-daemon in a way requesting all address families, it would be able to speed up response once we received at least response from one of the families.

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

No branches or pull requests

1 participant