• Nils Goroll's avatar
    Fix races for streaming busy objects · aca69dac
    Nils Goroll authored
    For streaming busy objects, we basically rely on the varnish-cache
    ObjExtend() / ObjWaitExtend() API to never read past the object: In
    fellow_stream_f(), we always wait for more data (or the end of the
    object) before returning, such that fellow_cache_obj_iter(), which
    iterates over segments, should never touch a segment past the final
    FCS_BUSY segment.
    
    Yet - it did, by means of the read-ahead and the peek-ahead to determine
    whether or not OBJ_ITER_END should be signaled.
    
    We fix this issue by reading/peeking ahead only for segments with a
    state beyond FCS_BUSY.
    
    There is now also extensive test infrastructure to specifically test
    concurrent access ti busy objects. To keep layers separate,
    fellow_cache_test uses a lightweight signal/wait implementation
    analogous to the ObjExtend() / ObjWaitExtend() Varnish-Cache
    interface.
    
    An earlier version of t_busyobj() had run on my dev laptop for 3.5
    hours without crashing, while without the fixes it had run into
    assertion failures within seconds.
    
    Fixes #35 and #36 (I hope)
    aca69dac
Name
Last commit
Last update
LICENSES Loading commit data...
logs Loading commit data...
src Loading commit data...
.gitignore Loading commit data...
BUGS.rst Loading commit data...
CHANGES.rst Loading commit data...
COPYING Loading commit data...
INSTALL.rst Loading commit data...
Makefile.am Loading commit data...
README.rst Loading commit data...
bootstrap Loading commit data...
configure.ac Loading commit data...