On Mon, Jun 20, 2011 at 11:39:46PM +0200, Cyril Bonté wrote:
> Le lundi 20 juin 2011 23:27:21, Willy Tarreau a écrit :
> > Timeouts are clearly the type of setting that should lie in a defaults
> > section, that's the best way not to forget any of them and to have them
> > coherent.
> 
> I totally agree, I only discovered their configuration too late and nothing 
> told them those timeouts will be ignored at startup.
> 
> Are you pro or against something that checks this in check_config_validity() ?
> 
> Something like this (extracted from a test case) :
> [WARNING] 170/232714 (6998) : Backend 'BE_SHOULD_WARN': 
> http-pretend-keepalive 
> timeout will be ignored for frontend 'FE_HTTP_1', which is already in HTTP 
> mode.
> [WARNING] 170/232714 (6998) : Backend 'BE_SHOULD_WARN': http-request timeout 
> will be ignored for frontend 'FE_HTTP_1', which is already in HTTP mode.
> [WARNING] 170/232714 (6998) : Backend 'BE_SHOULD_WARN': 
> http-pretend-keepalive 
> timeout will be ignored for frontend 'FE_HTTP_1', which is already in HTTP 
> mode.
> [WARNING] 170/232714 (6998) : Backend 'BE_SHOULD_WARN': http-request timeout 
> will be ignored for frontend 'FE_HTTP_1', which is already in HTTP mode.
> [WARNING] 170/232714 (6998) : Backend 'BE_SHOULD_WARN': 
> http-pretend-keepalive 
> timeout will be ignored for frontend 'FE_HTTP_2', which is already in HTTP 
> mode.
> [WARNING] 170/232714 (6998) : Backend 'BE_SHOULD_WARN': http-request timeout 
> will be ignored for frontend 'FE_HTTP_2', which is already in HTTP mode.
> 
> The configuration used for the test :
> defaults
>       timeout connect 10s
>       timeout client  11s
>       timeout server  12s
>       timeout http-keep-alive 1s
>       timeout http-request 2s
> 
> frontend FE_HTTP_1 :9001
>       mode http
>       use_backend BE_SHOULD_WARN if TRUE
>       use_backend BE_SHOULD_NOT_WARN if TRUE
>       default_backend BE_SHOULD_WARN
> 
> frontend FE_HTTP_2 :9002
>       mode http
>       use_backend BE_SHOULD_WARN if TRUE
>       use_backend BE_SHOULD_NOT_WARN if TRUE
>       default_backend BE_SHOULD_NOT_WARN
> 
> frontend FE_TCP_1 :9003
>       mode tcp
>       use_backend BE_SHOULD_NOT_WARN  if TRUE
>       use_backend BE_SHOULD_NOT_WARN_2 if TRUE
>       default_backend BE_SHOULD_NOT_WARN
> 
> frontend FE_TCP_2 :9004
>       mode tcp
>       use_backend BE_SHOULD_NOT_WARN   if TRUE
>       use_backend BE_SHOULD_NOT_WARN_2 if TRUE
>       default_backend BE_SHOULD_NOT_WARN_2
> 
> backend BE_SHOULD_WARN
>       mode http
>       option http-server-close
>       timeout http-keep-alive 3s
>       timeout http-request 3s
> 
> backend BE_SHOULD_NOT_WARN
>       mode http
>       option http-server-close
>       timeout http-keep-alive 1s
>       timeout http-request 2s
> 
> backend BE_SHOULD_NOT_WARN_2
>       mode http
>       option http-server-close
>       timeout http-keep-alive 3s
>       timeout http-request 3s

In my opinion these warnings do not help much here because there is already
a valid http-keep-alive timeout in the frontends (inherited from defaults)
so at most the backend's is ignored but the frontend's applies. Well, at
least it catches the incoherent cases where one believes the backend's
would apply. I'm dubious about the risk of false positive, while what we're
looking for is mainly the situation where the frontend's is not set while
the backend's is set.

For instance, if both an HTTP and a TCP frontend make use of the same
backend, I think it can be hard to write a config without any warning. Maybe
we should instead try to think about a way to apply more adequate semantics
on such timeouts so that they do what people would think first. For instance,
maybe if we consider that the backend's timeout overrides the frontend's
even in such situations, it makes sense (we should be even more careful
than for the warnings).

Regards,
Willy


Reply via email to