Hi,
I have HAProxy 3.0.8 running on a system with two network interfaces (eno1
1.2.3.4 and eno2 10.0.10.10).

The default route is on eno1.
More specific route to 10.0.0.0/8 is on eno2 - this is used for dns
resolution in HAProxy.

When the eno2 interface goes down (e.g. port on the network switch is
disabled) then HAProxy tries to do hostname resolution by sending requests
through eno1, which is expected as the more specific route is not available
anymore.

The issue is that when eno2 port is UP and running again, HAProxy still
tries to resolve hostnames through eno1. There are 3 workarounds to fix
this situation:
- the eno1 interface must be disabled and enabled again
- HAProxy must be reloaded
- tcp must be configured in the "resolvers" section of HAProxy.

My resolvers configuration is very basic:

resolvers default-dns
    parse-resolv-conf
    resolve_retries 100

It looks like HAProxy is creating a UDP socket once and is recreated only
when:
- HAProxy is reloaded
- the network interface state is changed.

The issue is pretty nasty, because after 100 retries (HAPoxy reports DNS
timeout which are expected) on eno1 HAProxy is giving up and it never goes
back to using the proper eno2 interface.

Maybe the udp socket should be recreated if any error (including dns
timeout) occurs?

Kind regards,

Reply via email to