Hello, I ran into a situation where a backend server stayed stuck in "DOWN (agent)" no matter what its health check did. It turned out agent.health is left at 0 when the agent-check is declared directly on the server line and the backend has no default-server: srv_settings_init() sets agent.rise but not agent.health, and that path became reachable for regular servers once defsrv was made optional in 3.3.
In my case the agent never reports the server up (it just closes the
connection), which is what leaves it stuck for good - a reply that doesn't
raise agent.health can't pull it back above rise.
This backend is broken (server stuck DOWN (agent), never recovers):
backend be
option httpchk
http-check expect status 200
server s1 127.0.0.1:8080 check agent-check agent-send foo \
agent-addr 127.0.0.1 agent-port 3333 agent-inter 2s
while the exact same settings moved to a default-server line work fine:
backend be
option httpchk
http-check expect status 200
default-server check agent-check agent-addr 127.0.0.1 \
agent-port 3333 agent-inter 2s
server s1 127.0.0.1:8080 agent-send foo
Both forms behaved identically (and correctly) in 3.2 and earlier.
The one-liner attached fixes it. I reproduced it on 3.3, 3.4 and current
master, and the same patch applies to all three.
Cheers,
Steven
0001-BUG-MEDIUM-server-initialise-agent.health-in-srv_set.patch
Description: Binary data

