This is related to the discourse thread (And also discuss the issues in ML instead of discourse).
https://discourse.haproxy.org/t/config-reload-with-dynamic-service-discovery-via-dns/2625/10 Here are the findings from my ends: 1 - State file / Port range invalid conversion In the haproxy state file the Port is written as an unsigned long value.. ie: Port 32777 is actually written 4294934537 112 defaultback_failsaife 1 varnish1 10.100.20.78 2 0 1 1 203910 15 3 4 6 0 0 0 ip-10-100-20-78.node.aws-us-east-1.consul 4294934537 _tcp_.varnish .service.consul To allow the seamless reload, I had to comment the following lines in the src/server.c if (port > USHRT_MAX) { chunk_appendf(msg, “, invalid srv_port value ‘%s’”, port_str); port_str = NULL; } 2 - Backend responds with 503 only after reload In order to make it functional, in the patch i had to comment the following lines : /* // prepare DNS resolution for this server (but aint this has already been done by the server-template function?) res = srv_prepare_for_resolution(srv, fqdn); if (res == -1) { ha_alert(“could not allocate memory for DNS REsolution for server … ‘%s’\n”, srv->id); chunk_appendf(msg, “, can’t allocate memory for DNS resolution for server ‘%s’”, srv->id); HA_SPIN_UNLOCK(SERVER_LOCK, &srv->lock); goto out; } */