]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: zero-weight servers must not dequeue requests from the backend
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Jan 2012 14:57:05 +0000 (15:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Jan 2012 15:18:53 +0000 (16:18 +0100)
commitf8e8b76ed381f011852b7be631d0247f69f3955f
tree71b8bdd6594c2eb5e6bfd10fe2c172cad980c972
parent62c3be28ed96dce88b93c5857a8a8b3bab083c73
BUG/MEDIUM: zero-weight servers must not dequeue requests from the backend

It was reported that a server configured with a zero weight would
sometimes still take connections from the backend queue. This issue is
real, it happens this way :
  1) the disabled server accepts a request with a cookie
  2) many cookie-less requests accumulate in the backend queue
  3) when the disabled server completes its request, it checks its own
     queue and the backend's queue
  4) the server takes a pending request from the backend queue and
     processes it. In response, the server's cookie is assigned to
     the client, which ensures that some requests will continue to
     be served by this server, leading back to point 1 above.

The fix consists in preventing a zero-weight server from dequeuing pending
requests from the backend. Making use of srv_is_usable() in such tests makes
the tests more robust against future changes.

This fix must be backported to 1.4 and 1.3.
include/proto/queue.h
src/queue.c