mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-18 13:05:38 +00:00
While fixing the backup server round-robin "feature", a new bug was introduced
which could miss some backup servers.
This commit is contained in:
parent
1fb3493492
commit
72e583d030
10
haproxy.c
10
haproxy.c
@ -1787,17 +1787,21 @@ static inline void session_free(struct session *s) {
|
|||||||
*/
|
*/
|
||||||
static inline struct server *find_server(struct proxy *px) {
|
static inline struct server *find_server(struct proxy *px) {
|
||||||
struct server *srv = px->cursrv;
|
struct server *srv = px->cursrv;
|
||||||
|
struct server *end;
|
||||||
int ignore_backup = 1;
|
int ignore_backup = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
if (srv == NULL)
|
||||||
|
srv = px->srv;
|
||||||
|
end = srv;
|
||||||
do {
|
do {
|
||||||
if (srv == NULL)
|
|
||||||
srv = px->srv;
|
|
||||||
if (srv->state & SRV_RUNNING
|
if (srv->state & SRV_RUNNING
|
||||||
&& !((srv->state & SRV_BACKUP) && ignore_backup))
|
&& !((srv->state & SRV_BACKUP) && ignore_backup))
|
||||||
return srv;
|
return srv;
|
||||||
srv = srv->next;
|
srv = srv->next;
|
||||||
} while (srv != px->cursrv);
|
if (srv == NULL)
|
||||||
|
srv = px->srv;
|
||||||
|
} while (srv != end);
|
||||||
|
|
||||||
/* By default, we look for the first backup server if all others are
|
/* By default, we look for the first backup server if all others are
|
||||||
* DOWN. But in some cases, it may be desirable to load-balance across
|
* DOWN. But in some cases, it may be desirable to load-balance across
|
||||||
|
Loading…
Reference in New Issue
Block a user