• Nils Goroll's avatar
    Add a director release callback to let go of all backends · e8c77d89
    Nils Goroll authored
    Before this patch, layered directors needed to be destroyed top to
    bottom, and whenever that order was missed, we would panic, because a
    to-be-destroyed director still had references to it.
    
    One special case where this issue would always trigger are looped
    directors. Those should not be used and will cause havoc, which is a
    separate issue #3899. But we should still be able to unconfigure such
    a configuration.
    
    We solve the destruction order issue by making it a two step process:
    
    When a director is destroyed through VRT_DelDirector, a new release
    function is called, which has to disassociate any backends. The
    director then loses a reference, and when all references are gone, the
    destroy function is called.
    
    The new callback would not be necessary for the cases in varnish-cache
    today, directors could simply disassociate any backends before calling
    VRT_DelDirector. But this would complicate or even make impossible
    transfer of director ownership, where the code responsible for
    creating a director is not the same as the one calling
    VRT_DelDirector(). As a side effect, it also helps clarity.
    
    Fixes #3895
    e8c77d89
Name
Last commit
Last update
.circleci Loading commit data...
.github Loading commit data...
bin Loading commit data...
contrib 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...
vmod Loading commit data...
.dir-locals.el 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...
vtc.am Loading commit data...
wflags.py Loading commit data...