For clients that are keeping their connection open, 503 replies from
haproxy seem to be silenced. The connection is just closed without sending
the 503 reply, if an earlier request has already been served on the same
connection.
git bisect tells me this appeared in
6b726adb35d998eb55671c0d98ef889cb9fd64ab, MEDIUM: http: do not report
connection errors for second and further requests
This kills haproxy in all our production setups since we base pretty much
all monitoring and small time static file serving on empty haproxy backends
with more or less clever 503 error files. As far as I can see, none of the
clients (will) retry the request.
Command to reproduce: echo -n -e 'POST /push HTTP/1.1\r\nContent-Length:
2\r\n\r\n[]\r\nGET /status HTTP/1.1\r\n\r\n' | nc localhost 6666
Somewhat minimal config:
global
log <somewhere> local6
maxconn 262144
defaults
log global
mode http
option httplog
timeout queue 120s
timeout connect 5s
timeout client 50s
timeout server 50s
timeout check 5s
option http-server-close
frontend fe
bind :6666
use_backend ana-events if { url_beg /push }
use_backend status-ok if { url_beg /status }
backend status-ok
# empty backend to force 503
response
# errorfile 503
errors/ok.json
backend ana-events
option httpchk GET /status
server <blah> <blah>:13362 maxconn 4 check
Expected result : 2 replies, actual result: only one reply.