• Nils Goroll's avatar
    When connecting to backends, respect the administrative health · fe5e8265
    Nils Goroll authored
    When making a connection a "real" backend (VBE), we checked the probed
    health state and did not take into account the administrative health
    state as set with `varnishadm backend.set_health ... {healthy,sick}`.
    
    Our documentation was not particularly explicit on this aspect either,
    but the administrative states `sick` and `healthy` made no sense if
    `auto` semantics was implied always. Also, the semantics were implicitly
    documented for `backend.list`.
    
    Implementation note:
    
    The relevant change is to call `VRT_Healthy()`, which does check the
    administrative health, in place of checking `(struct backend *)->sick`
    in `vbe_dir_getfd()`.
    
    As a `VRT_CTX` is required by `VRT_Healthy()`, we change the arguments of
    `vbe_dir_getfd()` accordingly: The busyobj can now be taken from the ctx,
    but the worker argument differs for pipe mode vs. fetch, so we preserve
    it as an explicit argument.
    
    A test for overriding a probed backend as healthy has been added to
    c00048.vtc, which requires a second probe to hit server s1 and fail.
    This is timing sensitive, so I hope that the backend probe interval
    of 5 seconds is long enough for all our test environments. If not,
    we probably need to make it longer or add another vtc.
    
    Fixes #3299
    fe5e8265
cli_cmds.h 10.4 KB