]> git.kaiwu.me - haproxy.git/commit
[MEDIUM] checks: support multi-packet health check responses
authorNick Chalk <nick@loadbalancer.org>
Tue, 16 Mar 2010 15:50:46 +0000 (15:50 +0000)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Mar 2010 21:57:26 +0000 (22:57 +0100)
commit57b1bf778590b9a87409a676a110400fdb58b383
tree6f7836f51ce36b7381cb83775493e9b675ea8590
parent396504089897fd373c87435eb4d51c6e7ae1f32e
[MEDIUM] checks: support multi-packet health check responses

We are seeing both real servers repeatedly going on- and off-line with
a period of tens of seconds. Packet tracing, stracing, and adding
debug code to HAProxy itself has revealed that the real servers are
always responding correctly, but HAProxy is sometimes receiving only
part of the response.

It appears that the real servers are sending the test page as three
separate packets. HAProxy receives the contents of one, two, or three
packets, apparently randomly. Naturally, the health check only
succeeds when all three packets' data are seen by HAProxy. If HAProxy
and the real servers are modified to use a plain HTML page for the
health check, the response is in the form of a single packet and the
checks do not fail.

(...)
I've added buffer and length variables to struct server, and allocated
space with the rest of the server initialisation.

(...)
It seems to be working fine in my tests, and handles check responses
that are bigger than the buffer.
include/types/server.h
src/cfgparse.c
src/checks.c
src/haproxy.c