]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: action: do-resolve does not yield on requests with body
authorBaptiste Assmann <bedis9@gmail.com>
Tue, 1 Oct 2019 13:32:40 +0000 (15:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 1 Oct 2019 13:50:50 +0000 (15:50 +0200)
commit4c52e4b5605437ee55de2679b5031254f02e7929
treec131e45544ebe0a5e038328d143431c3a98f6073
parent2aaeee34da7a7e5e05ed72d2e55077cb11911b2c
BUG/MINOR: action: do-resolve does not yield on requests with body

@davidmogar reported a github issue (#227) about problems with
do-resolve action when the request contains a body.
The variable was never populated in such case, despite tcpdump shows a
valid DNS response coming back.

The do-resolve action is a task in HAProxy and so it's waken by the
scheduler each time the scheduler think such task may have some work to
do.
When a simple HTTP request is sent, then the task is called, it sends
the DNS request, then the scheduler will wake up the task again later
once the DNS response is there.
Now, when the client send a PUT or a POST request (or any other type)
with a BODY, then the do-resolve action if first waken up once the
headers are processed. It sends the DNS request. Then, when the bytes
for the body are processed by HAProxy AND the DNS response has not yet
been received, then the action simply terminates and cleans up all the
data associated to this resolution...

This patch detect such behavior and if the action is now waken up while
a DNS resolution is in RUNNING state, then the action will tell the
scheduler to wake it up again later.

Backport status: 2.0 and above
src/dns.c