While I prefer your solution, I suspect that it would not be possible/worth it to change the behavior at this point. It seems likely there is some niche setup out there that relies on the current logic in some capacity.
I can imagine something along the lines of: someone sets up a hostname that points to 2 IP records that each use different network infra or something like that. In the case where you are looking for a primary you would not want to duplicatively check the same host in this scenario because you already confirmed that it is not the one you are looking for. With your patch you would be increasing connection latency, probably not by that much granted but this is the scenario that encouraged me to implement this as a new parameter. All that being said I'm fine with either patch and would love to see one of them get merged. I suspect there are a lot of extraneous haproxy's that have been set up in the wild that would be unneeded if one of our our patches were merged and the changes proliferate to downstream drivers. One note on your patch though: you may want to incorporate the unit tests that I built out for this patch in yours.
