On Fri, Sep 25, 2009 at 2:28 PM, Willy Tarreau <w#1wt.eu> wrote:
> On Fri, Sep 25, 2009 at 10:59:48PM +0200, Krzysztof Oledzki wrote:
>> > if (s->proxy->options2 & PR_O2_LOGHCHKS &&
>> >- (((s->state & SRV_RUNNING) && (s->result & SRV_CHK_ERROR)) ||
>> >- (!(s->state & SRV_RUNNING) && (s->result & SRV_CHK_RUNNING)) ||
>> >+ (((s->health != 0) && (s->result & SRV_CHK_ERROR)) ||
>> >+ ((s->health != s->rise + s->fall - 1) && (s->result &
>> >SRV_CHK_RUNNING)) ||
>> > ((s->state & SRV_GOINGDOWN) && !(s->result & SRV_CHK_DISABLE)) ||
>> > (!(s->state & SRV_GOINGDOWN) && (s->result & SRV_CHK_DISABLE))))
>> > {
>>
>> Indeed, it is good idea to log such situations. Your condition looks much
>> better. ;)
>
> >> >A workaround could be to report the number of checks left before UP >> >or DOWN, which depends on the server status and health. If UP with >> >a failed check, we report "(health-rise) checks left before going down", >> >and if we have a DOWN state with a successful check, we could report >> >"(rise-1-health) checks left before going up". That's just an idea. >> >> Looks very reasonable, I'll try to implement it. >
> >> >Hmm I've just tested with "http-check disable-on-404", and the >> >404 are reported as failed checks while the health increases. >> >Here again it's not easy because a 404 is a success if the server >> >is UP, and a failure if the server is down. >> >> For me 404 is always failed check, even with disable-on-404 as it disables >> balancing to that server. Maybe with disable-on-404 it is not fatal - a >> proxy may decide that a server is up, but still... >
> >> >I think that computing a "direction" variable at the top of the function >> >should help a lot, it would contain -1 if the check is a failure, 1 if >> >it's a success, or 0 if it has no impact. >> > >> >I think that a success is designated by : >> > >> > (SRV_RUNNING && CHK_DISABLE) || (health < rise+fall-1 && CHK_RUNNING) >> > >> >A failure should be : >> > >> > (!SRV_RUNNING && CHK_DISABLE) || (health != 0 && CHK_ERROR) >> > >> >I'm not sure for the last one if it takes into account the check >> >timeout (maybe we don't have CHK_ERROR in this case). >> >> I need to think a little about it, but generally it should work. >
> >> However, >> as I stated above - I don't want to call it as a succeeded check, but if >> you insist we may add third case - "conditionally succeeded". What do you >> think? >
>
>
>
> > >Received on 2009/09/25 23:36
This archive was generated by hypermail 2.2.0 : 2009/09/25 23:45 CEST