Hi Everyone,

There is no limit for the value of inter parameter.
Same query was asked in the community :- 
https://discourse.haproxy.org/t/maximum-value-for-inter-parameter/2142

Here, I have created a patch (Version - 1.8.1) for limiting the maximum value 
of "inter" parameter.

As currently, no parsing error is displayed when larger value is given to 
"inter" parameter in config file.
After applying this patch the maximum value of "inter" is set to 24h (i.e. 
86400000 ms).
If user enter any value > 24h then parsing error would be displayed.

Please let me know if the patch is fine and can be merged to the main branch.

Thanks
Nikhil Kapoor

Attachment: inter_max_check.patch
Description: inter_max_check.patch

Problem:- No parsing error is displayed when larger value is given to "inter" 
parameter in config file.

A parsing error should be displayed on the screen.

Detailed steps:

1.Create 3 nodes setup(node1, node3 as backend servers, HAProxy is installed on 
node2.
2.Set 'inter 10000000000'in haproxy.config 
3.Start Haproxy (systemctl restart haproxy)and check status of haproxy 
(#systemctl status haproxy)

When value of 'inter' parameter is "10000000000" in haproxy.cfg and haproxy 
service is started, no parsing error is displayed.

Solution:- 
A check has been extended in parse_server() of server.c file, to verify the 
parameter value and display the parsing error if a value is greater than 
24h(86400000 ms) process termination.


<                                 /* The value of 'inter' parameter cannot be 
greater than 24 hours */
<                               if (val <= 0 || val >86400000) {
---
>                               if (val <= 0 ) {


Reply via email to