]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: checks: properly set servers to stopping state on 404
authorWilly Tarreau <w@1wt.eu>
Sat, 23 Dec 2017 10:16:49 +0000 (11:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 23 Dec 2017 10:16:49 +0000 (11:16 +0100)
commitb26881a5d52c8e4abd61a8305c24baf3df990d59
treefb04dfda143606ab24d35a8f49769486473baa2d
parenta48c141f448e04f6da8a5b40c677042fbc730f04
BUG/MEDIUM: checks: properly set servers to stopping state on 404

Paul Lockaby reported that since 1.8, disable-on-404 doesn't work
anymore in that the server stay up despite returning 404. Cyril spotted
that this was caused by a copy-paste error introduced by commit 5a13351
("BUG/MEDIUM: log: check result details truncated.") causing
set_server_running() to be called instead of set_server_stopping() in
this case.

It can be reproduced with the simple test config below :

  defaults
     mode http
     timeout connect 1s
     timeout client  10s
     timeout server  10s

  listen http
     bind :8888
     option httpchk GET /
     http-check disable-on-404
     server s1 127.0.0.1:9001 check
     server s2 127.0.0.1:9002 check
     http-response add-header x-served-by %s

  listen s1
     bind :9001
     server next 127.0.0.1:9002
     http-response set-status 404

  frontend s2
     bind :9002
     http-request redirect location /

S1 is supposed to be stopping and s2 up, which is not the case. After
calling the correct function, only S2 is used now.

This needs to be backported to 1.8.
src/checks.c