]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG: MAJOR: lb_map: server map calculation broken
authorCyril Bonté <cyril.bonte@free.fr>
Thu, 14 Dec 2017 15:39:26 +0000 (16:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Dec 2017 16:36:39 +0000 (17:36 +0100)
Adrian Williams reported that several balancing methods were broken and
sent all requests to one backend. This is a regression in haproxy 1.8 where
the server score was not correctly recalculated.

This fix must be backported to the 1.8 branch.

src/lb_map.c

index ecab4de1394a139046f6938fa7992da4a5459eda..a1e1d34927f9eaa14d74234a0f00862d1c87fc5d 100644 (file)
@@ -122,7 +122,7 @@ void recalc_server_map(struct proxy *px)
                        }
                }
                px->lbprm.map.srv[o] = best;
-               HA_ATOMIC_ADD(&best->wscore, tot);
+               HA_ATOMIC_SUB(&best->wscore, tot);
        }
 }