Ordering of configuration commands

Hello,

I believe I may have found a bug, and if so not sure where to report it. Your feedback is very much appreciated.

So, here it goes. This config will check every 5s interval.

backend www
mode http
default-server inter 5s fall 3 rise 2
server test 1.2.3.4:80 check

and this config will check every 2s interval.

backend www
mode http
server test 1.2.3.4:80 check
default-server inter 5s fall 3 rise 2

why? :slight_smile: Shouldn’t it be 5s for both?

HAProxy version 1.6.3, released 2015/12/25

Thanks,
Sam

This is simply related to the way HAProxy parses a configuration file.
I think the documentation is not accurate enough and should report that default-server applies for the servers below it, (and mybe until the next default-server directive).

That is surprising.

The official Chef cookbook got it wrong GitHub - sous-chefs/haproxy: Development repository for the haproxy cookbook

the documentation is not accurate enough and should report

configuration.txt is 15,000 lines long and so it will be a needle in a haystack. I wonder if a warning message at startup would make sense. Or, if the code should change, since this is a configuration file, and they are usually not dependent on ordering. … unless this is an intentional feature, which it may be.

No warning message, since this type of configuration may be valid in some cases.