On Thu, Oct 14, 2010 at 04:21:46PM +0200, Dariusz Suchojad wrote: > > Hi, > > I was a bit surprised that a config file below did pass the validation > done with "haproxy -c -f config_file" using HA-Proxy version 1.3.22 > 2009/10/14 and the current latest HA-Proxy version 1.5-dev2 2010/08/28. > > I wouldn't have spotted it if I weren't writing a simple parser for the > HAProxy config file's grammar and one of my tests stubbornly didn't want > to fail even though I was feeding it with what I thought was an invalid > config :-) > > What do you think of it?
In fact, it's valid for haproxy. The validation check consists in parsing the file and building the entire internal configuration tree, then exit just before the point where it would have started the listeners. The time parser only checks for a few known substrings after the digits, which is the reason why it works here when you write "2saaaaaaa". It only retains "2s". We thought about improving the parser in the past, in order to support multiple units. For instance : "2d4h30m15s". When the parser supports that, it will fail on the "aaa" above. But it's true that right now it does not. I'll check if something trivial can be done about this. I'd also rather fail early than let people keep non-upgradable configs. Thanks! Willy

