• Dridi Boukelmoune's avatar
    varnishtest: Make barriers reactive on error · 3c67da44
    Dridi Boukelmoune authored
    A failing test may take up to the vtc timeout to effectively fail if a
    thread is waiting for a barrier to sync. Barriers now check every 100ms
    whether the vtc is done to bail out.
    
    The socket barriers were already polling for 1s, so now they poll for
    100ms and leave the loop early when needed.
    
    The condvar barriers now loop over a timedwait, but critical sections
    were too wide. There were vtc_fatal() calls under barrier locks that
    would defeat the timedwait loop.
    
    Thus critical sections were more carefully laid, allowing multiple
    barrier commands to run simultaneously. This also means that besides
    initialization, socket barriers no longer touch the lock.
    
    Consider the following diff:
    
        --- bin/varnishtest/tests/v00056.vtc
        +++ bin/varnishtest/tests/v00056.vtc
        @@ -72,7 +72,7 @@ client c2 {
         } -run
    
         logexpect l2 -v v1 -g raw -q Backend_health {
        -       expect 0 0 Backend_health "default Went healthy"
        +       expect 0 0 Backend_health "default Went wrong"
         } -start
    
         barrier b3 sync
    
    With this change l2 would fail early, typically in less than 2s, but the
    barriers stuck in a condwait would prevent further progress.
    3c67da44
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...
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...