On 5/8/26 1:52 AM, wlswo wrote: > When the python unbound library is unavailable, dns_resolve.resolve() > returns None, and any host name passed to inet_parse_active() ends up > producing a misleading "bad peer name format" error. The peer name > format may be perfectly fine; the actual problem is that DNS support > is disabled.
Hi, wlswo. I'm not sure why we need this new message. The format is wrong for the setup without DNS support, so while not precise, it's not really incorrect. Also, there is a message right above this one already printed saying that DNS is not supported. Why is it not enough? If the user needs to look at the logs anyway, they should see it. > > Add a public dns_resolve.is_enabled() helper so callers can tell "DNS > unavailable" apart from "DNS lookup failed", and use it in > _inet_parse_active() to raise a clearer error pointing at the missing > unbound library when applicable. > > This does not introduce any blocking I/O: the IP-literal fast path is > unchanged, and the new branch only fires after dns_resolve.resolve() > has already returned None, replacing the existing exception with a > more informative one. > > Link: https://mail.openvswitch.org/pipermail/ovs-dev/2026-May/432092.html > > After discussion on the v1 patch (linked above), introducing a blocking > DNS fallback was rejected because synchronous DNS is unsuitable for OVS > daemons. This patch takes a different approach: rather than enabling > hostname resolution without unbound, it makes the existing failure mode > clearer so users know to install python3-unbound. > > Tested: Ran the python test suite under PYTHONPATH=python; the new > test_inet_parse_active_missing_unbound and test_is_enabled_without_init > cases pass, and the extended test_missing_unbound now also asserts the > expected dns_resolve.is_enabled() return value. > > Assisted-by: Claude Opus 4.7, Claude Code > Signed-off-by: wlswo <[email protected]> Note: for the future, please, provide the sign-off tag in the following format, if possible: Signed-off-by: Full Name <[email protected]> Best regards, Ilya Maximets. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
