• Dridi Boukelmoune's avatar
    vca: Have one inheritance check per listen socket · ca928ab3
    Dridi Boukelmoune authored
    Instead of having a single global check that all acceptors may race
    towards, this check now happens on a per listen socket basis. For
    sockets with a different inheritance behavior on a single system, we
    avoid having the first connection dictate what may be inherited by
    a connection socket from its listen socket for all the other listen
    addresses.
    
    At least on Linux, Unix-domain sockets DO NOT inherit options like
    SO_{RCV,SND}TIMEO even though TCP sockets do. On the off chance that
    even sockets of the same family could behave differently, like for
    example a regular vs a loopback TCP session, this is done on a per
    listen address basis. To avoid cache-acceptor coordination with the
    acceptor worker threads of a given listen address, workers will
    individually perform this check once and for all when the first
    connection is accepted.
    
    We also stay defensive in the event of a parameter change, just in
    case a previous test would assume inheritance because the Varnish
    parameter value would match the kernel default value. Once a mismatch
    is observed for a given connection with a given socket, the inheritance
    test is no longer performed needlessly for this combination.
    
    A race still exists between acceptors from different thread pools for
    a given listen address, but this race is identical to the previous one
    based on the former global need_test variable.
    
    Although the inheritance check leaks into struct listen_sock, it is
    opaque so everything can remain contained inside cache_acceptor.c.
    
    Some aspects of this change (including the clarification comments) are
    from @mbgrydeland.
    
    Refs #2722
    ca928ab3
Name
Last commit
Last update
..
cache.h Loading commit data...
cache_acceptor.c Loading commit data...
cache_backend.c Loading commit data...
cache_backend.h Loading commit data...
cache_backend_probe.c Loading commit data...
cache_ban.c Loading commit data...
cache_ban.h Loading commit data...
cache_ban_build.c Loading commit data...
cache_ban_lurker.c Loading commit data...
cache_busyobj.c Loading commit data...
cache_cli.c Loading commit data...
cache_deliver_proc.c Loading commit data...
cache_director.c Loading commit data...
cache_director.h Loading commit data...
cache_esi.h Loading commit data...
cache_esi_deliver.c Loading commit data...
cache_esi_fetch.c Loading commit data...
cache_esi_parse.c Loading commit data...
cache_expire.c Loading commit data...
cache_fetch.c Loading commit data...
cache_fetch_proc.c Loading commit data...
cache_filter.h Loading commit data...
cache_gzip.c Loading commit data...
cache_hash.c Loading commit data...
cache_http.c Loading commit data...
cache_lck.c Loading commit data...
cache_main.c Loading commit data...
cache_mempool.c Loading commit data...
cache_obj.c Loading commit data...
cache_obj.h Loading commit data...
cache_objhead.h Loading commit data...
cache_panic.c Loading commit data...
cache_pool.c Loading commit data...
cache_pool.h Loading commit data...
cache_range.c Loading commit data...
cache_req.c Loading commit data...
cache_req_body.c Loading commit data...
cache_req_fsm.c Loading commit data...
cache_rfc2616.c Loading commit data...
cache_session.c Loading commit data...
cache_shmlog.c Loading commit data...
cache_tcp_pool.c Loading commit data...
cache_tcp_pool.h Loading commit data...
cache_transport.h Loading commit data...
cache_varnishd.h Loading commit data...
cache_vary.c Loading commit data...
cache_vcl.c Loading commit data...
cache_vcl.h Loading commit data...
cache_vcl_vrt.c Loading commit data...
cache_vgz.h Loading commit data...
cache_vrt.c Loading commit data...
cache_vrt_priv.c Loading commit data...
cache_vrt_re.c Loading commit data...
cache_vrt_var.c Loading commit data...
cache_vrt_vmod.c Loading commit data...
cache_wrk.c Loading commit data...
cache_ws.c Loading commit data...