Welcome! Log In Create A New Profile


Removed health check in combination with load-server-state-from-file (Bug)

Posted by Tim Düsterhus 

I run haproxy with 'load-server-state-from-file'. Before reloading
haproxy I dump the state using:

echo show servers state |nc -U admin.sock > /etc/haproxy/state/global

I noticed a buggy behaviour with this:

1. Check that the backend is 'DOWN'.
2. Dump the state using the command above (the 'DOWN' state is written
into the file).
3. Remove the health check of the backend.
4. Reload haproxy.
5. The backend will now be 'DOWN' forever, as the initial state taken
from the file is 'DOWN' and no health checks are running.

I attached an example configuration and an example state file. To
reproduce the issue:

1. Start haproxy.
2. Open the Stats page.
3. Place the state file.
4. Remove the 'check' from the configuration.
5. Reload haproxy.
6. Start the backend.
7. Reload the Stats page and notice that the backend still is 'DOWN'.

# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id
3 bk_http 1 nginx 0 0 1 1 374 7 0 0 7 0 0 0

stats socket /admin.sock mode 666 level admin

server-state-file global
server-state-base /etc/haproxy/state/

log global
timeout connect 5s
timeout client 50s
timeout server 50s

load-server-state-from-file global

frontend fe_http
mode http
bind :::80 v4v6

default_backend bk_http

backend bk_http
mode http

option httpchk GET /

server nginx check

listen stats
bind :1936

mode http
stats enable
stats uri /
stats hide-version
Sorry, only registered users may post in this forum.

Click here to login