• Dridi Boukelmoune's avatar
    Only let VRT_AddDirector undo a COOLING attempt · 07a09db9
    Dridi Boukelmoune authored
    When a VCL is in the COOLING state it is supposed to delete the director
    that was being added, but at the same time when a VBE backend fails to
    be added as a director it would also undo itself.
    
    This is in general a code path very hard to reach because either this
    happens in a worker and the opportunistic check always kicks in to hide
    the problem or this is done asynchronously (e.g. non-blocking lookups to
    create dynamic backends) and the race window is very small. In order to
    solve this the opportunistic check is skipped in VTC mode.
    
    The test coverage with vmod_debug is done synchronously to make things
    easier, but for this reason vbe_destroy can no longer expect to only run
    in the CLI thread.
    
    This is inspired by a similar patch by Martin for a different branch,
    since VRT_AddDirector deletes the backend upon failure, everything needs
    to be set up beforehand.
    
    We have to tolerate backend creation attempts in a COOLING VCL because
    in the asynchronous case the VCL temperature will change before COLD
    events are dispatched so there's no way to prevent a race.
    
    Closes #3176
    07a09db9
Name
Last commit
Last update
.circleci Loading commit data...
.github Loading commit data...
bin Loading commit data...
doc Loading commit data...
etc Loading commit data...
include Loading commit data...
lib Loading commit data...
m4 Loading commit data...
man Loading commit data...
tools Loading commit data...
.dir-locals.el Loading commit data...
.envrc Loading commit data...
.gitignore Loading commit data...
.lgtm.yml Loading commit data...
.syntastic_c_config Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING Loading commit data...
ChangeLog Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
Makefile.am Loading commit data...
README.Packaging Loading commit data...
README.rst Loading commit data...
autogen.des Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
flint.lnt Loading commit data...
varnish-legacy.m4 Loading commit data...
varnish.m4 Loading commit data...
varnishapi-uninstalled.pc.in Loading commit data...
varnishapi.pc.in Loading commit data...