• Nils Goroll's avatar
    close a race between VBP_Control() and vbp_thread() wrt VBH index · a494a1e2
    Nils Goroll authored
    VBP_Control() asserts that, when the vcl is warm, probes are scheduled
    to run (that is, exist on the probe scheduling binheap) and not so
    when the VCL is cold. This is correct because any VCL events are
    guaranteed to be serialized by mgt.
    
    vbp_thread(), however, momentarily left probes removed from the
    binheap while scheduling a probe not holding vbp_mtx, which left a
    window for VBP_Control() to find an active probe not on the binheap.
    
    Both vbp_thread() and vbp_task() re-schedule the probe at hand. The
    former in case scheduling the task fails, and the latter to reschedule
    it at the right interval relative to the probe having finished.
    
    We now re-schedule the probe in vbp_thread() before adding a task to
    run it, which does not change anything about the above, and, in
    particular, keeps vbp_mtx free while adding the probe task.
    
    Yet it closes the race and thus
    
    fixes #3362
    
    survived varnishtest -t 90 -n 10000 -j 200 -i tests/v00003.vtc
    a494a1e2
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...
.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...