BUG/MEDIUM: checks: unchecked servers could not be enabled anymore

Recent fix 02541e8 (BUG/MEDIUM: checks: servers must not start in
slowstart mode) failed to consider one case : a server chich is not
checked at all can be disabled and has to support being enabled
again. So we must also enter the set_server_up() function when the
checks are totally disabled.

No backport is needed.
This commit is contained in:
Willy Tarreau 2013-12-28 21:21:31 +01:00
parent 3988d9342f
commit e24d96393a

View File

@ -483,7 +483,8 @@ void set_server_up(struct check *check) {
((s->check.state & CHK_ST_ENABLED) && (s->check.health == s->check.rise) && ((s->check.state & CHK_ST_ENABLED) && (s->check.health == s->check.rise) &&
(s->agent.health >= s->agent.rise || !(s->agent.state & CHK_ST_ENABLED))) || (s->agent.health >= s->agent.rise || !(s->agent.state & CHK_ST_ENABLED))) ||
((s->agent.state & CHK_ST_ENABLED) && (s->agent.health == s->agent.rise) && ((s->agent.state & CHK_ST_ENABLED) && (s->agent.health == s->agent.rise) &&
(s->check.health >= s->check.rise || !(s->check.state & CHK_ST_ENABLED)))) { (s->check.health >= s->check.rise || !(s->check.state & CHK_ST_ENABLED))) ||
(!(s->agent.state & CHK_ST_ENABLED) && !(s->check.state & CHK_ST_ENABLED))) {
if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) { if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) {
if (s->proxy->last_change < now.tv_sec) // ignore negative times if (s->proxy->last_change < now.tv_sec) // ignore negative times
s->proxy->down_time += now.tv_sec - s->proxy->last_change; s->proxy->down_time += now.tv_sec - s->proxy->last_change;