mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-18 19:56:59 +00:00
BUG/MAJOR: threads/lb: fix missing unlock on map-based hash LB
We often left the function with the lock held on success.
This commit is contained in:
parent
1ed90ac377
commit
03071f6937
@ -224,13 +224,13 @@ struct server *map_get_server_rr(struct proxy *px, struct server *srvtoavoid)
|
||||
srv = px->lbprm.map.srv[newidx++];
|
||||
if (!srv->maxconn || (!srv->nbpend && srv->served < srv_dynamic_maxconn(srv))) {
|
||||
/* make sure it is not the server we are try to exclude... */
|
||||
/* ...but remember that is was selected yet avoided */
|
||||
avoided = srv;
|
||||
avoididx = newidx;
|
||||
if (srv != srvtoavoid) {
|
||||
px->lbprm.map.rr_idx = newidx;
|
||||
return srv;
|
||||
goto out;
|
||||
}
|
||||
|
||||
avoided = srv; /* ...but remember that is was selected yet avoided */
|
||||
avoididx = newidx;
|
||||
}
|
||||
if (newidx == px->lbprm.tot_weight)
|
||||
newidx = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user