------------------------------------------------------------------------
*From: *Cyril Bonté <cyril.bo...@free.fr>
*Sent: * 2014-04-13 11:15:26 E
*To: *Patrick Hemmer <hapr...@stormcloud9.net>
*CC: *haproxy@formilux.org
*Subject: *Re: suppress reqrep / use_backend warning

> Hi Patrick,
>
> Le 08/04/2014 23:04, Patrick Hemmer a écrit :
>> Would it be possible to get an option to suppress the warning when a
>> reqrep rule is placed after a use_backend rule?
>> [WARNING] 097/205824 (4777) : parsing
>> [/var/run/hapi/haproxy/haproxy.cfg:1443] : a 'reqrep' rule placed after
>> a 'use_backend' rule will still be processed before.
>>
>> I prefer keeping my related rules grouped together, and so this message
>> pops up every time haproxy is (re)started. Currently it logs out 264
>> lines each start (I have a lot of rules), and is thus fairly annoying. I
>> am well aware of what the message means and my configuration is not
>> affected by it.
>
>
> Do you want to ignore every warnings or only some warnings ?
I would think ignoring only some warnings would be preferable. Ignoring
all warnings might lead to people disabling them all, and then when a
new warning comes up that hasn't been seen before, it'll be missed.

>
> For the first case you can use the global keyword "quiet" (or its
> command line equivalent "-q").
Ah, didn't know `quiet` would suppress warnings as well. This might be
acceptable.

>
> For the second one, there is nothing available yet, but I was thinking
> of something like annotations in configuration comments.
> For example :
> - @ignore-warnings to ignore the warnings of the current line
> - @BEGIN ignore-warnings to start a block of lines where warnings will
> be ignored
> - @END ignore-warnings to stop ignoring warnings.
>
> frontend test :8888
>   mode http
>   reqrep ^([^\ :]*)\ /static/(.*)     \1\ /\2
>   block if TRUE   # @ignore-warnings
>   block if FALSE  # @ignore-warnings
>   block if TRUE
>   block if TRUE
>   block if TRUE
>   # @BEGIN ignore-warnings
>   block if TRUE
>   block if TRUE
>   block if TRUE
>   block if TRUE
>   block if TRUE
>   # @END ignore-warnings
>   block if TRUE
>   block if TRUE
>   block if TRUE
>
> Please find a quick and dirty patch to illustrate. Is this something
> that could be useful ?
Hadn't really thought about the best way to solve it until now. I like
the per-line suppression more than the @BEGIN/@END one. The only other
way I can think of doing this is by having a config directive such as:
ignore-warnings reqrep_use_backend
Which would suppress all occurrences of that specific warning. But then
the warning message itself would need some sort of identifier on it so
we knew what argument to pass to 'ignore-warnings'

I'll play with the patch tomorrow, see how manageable it is.

But really, this is a trivial matter. I'd be OK with whatever is decided.


-Patrick

Reply via email to