1. 05 Aug, 2022 5 commits
  2. 04 Aug, 2022 3 commits
  3. 12 Jan, 2022 1 commit
  4. 11 Jan, 2022 3 commits
  5. 23 Nov, 2021 2 commits
  6. 22 Nov, 2021 1 commit
    • Poul-Henning Kamp's avatar
      Hopefully fix u00006 on various platforms. · bec768df
      Poul-Henning Kamp authored
      Dont limit ourselves to a set number of VSL records to include
      the "0 CLI" we want, various platforms emit a number of Debug
      messages relating to sockopt
      
      Use the `process p%d -expect-text` mechanism to wait only as
      long as necessary for the "0 CLI"
      bec768df
  7. 19 Nov, 2021 4 commits
  8. 17 Nov, 2021 10 commits
    • Dridi Boukelmoune's avatar
      build: Simply require that SO_???TIMEO are present · 254faf07
      Dridi Boukelmoune authored
      Closes #3692
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      254faf07
    • Dridi Boukelmoune's avatar
      6093812b
    • Dridi Boukelmoune's avatar
      vca: Have one inheritance check per listen socket · 9c6f6043
      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
      9c6f6043
    • Dridi Boukelmoune's avatar
      vca: Give sock_opt constant arguments better names · 58ac9f83
      Dridi Boukelmoune authored
      And while at it, update the SO_LINGER explanation to match reality.
      
      Refs 7eba9460
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      58ac9f83
    • Dridi Boukelmoune's avatar
      vca: Give all const socket options placeholers · 439f2619
      Dridi Boukelmoune authored
      The SO_KEEPALIVE justification used to precede such a constant and was
      left confusingly lingering over the unrelated need_test variable.
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      439f2619
    • Dridi Boukelmoune's avatar
      vca: Generalize the sock options test · 32ae0413
      Dridi Boukelmoune authored
      Using the tmp sock_arg for storage, we can test all values with the same
      logic and only differentiate hard-coded options from parameterized ones.
      
      Stylistic polish by @mbgrydeland.
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      32ae0413
    • Dridi Boukelmoune's avatar
      vca: Eliminate heap allocations of sock_opt arguments · 763cc6ef
      Dridi Boukelmoune authored
      They can be stored directly in the sock_opts array or on the stack.
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      763cc6ef
    • Dridi Boukelmoune's avatar
      vca: Pass higher-level types to sock_opt functions · 741c872c
      Dridi Boukelmoune authored
      The sess and listen_sock structs contain everything we need to find or
      infer the former `sock`, `uds` and `force` arguments. In particular, it
      helps distinguish between working on a connection vs listen socket.
      741c872c
    • Dridi Boukelmoune's avatar
      vca: Rename tcp_opt to a more general sock_opt · 1780645d
      Dridi Boukelmoune authored
      And conversely rename `to` variables to `so` for consistency.
      
      Better diff with the --word-diff --word-diff-regex='\w+' options.
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      1780645d
    • Dridi Boukelmoune's avatar
      vca: Remove the tcp_opt::iponly field · 258471a3
      Dridi Boukelmoune authored
      It is a 1:1 mapping with IPPROTO_TCP, so TCP_NODELAY was moved down to
      be with the other IPPROTO_TCP options.
      
      Conflicts:
      	bin/varnishd/cache/cache_acceptor.c
      258471a3
  9. 16 Nov, 2021 8 commits
    • Martin Blix Grydeland's avatar
      Amend the docs on the '-I' option · d084467a
      Martin Blix Grydeland authored
      Make a note in the documentation of CLI Command File that it is necessary
      to include an explicit 'vcl.use' command in the script.
      d084467a
    • AlveElde's avatar
      Test case for handling initially cold VCLs · a72a28a2
      AlveElde authored
      a72a28a2
    • Martin Blix Grydeland's avatar
      Limit automatic active VCL selection to startup VCLs · dda20238
      Martin Blix Grydeland authored
      Limit the selection of the active VCL from MGT's view point to be the last
      startup VCL given. That would be the VCL from the very last -f argument
      given to varnishd, or the autogenerated VCL from the -b argument (-f and
      -b are mutually exclusive). Because all startup VCLs are always set to
      state AUTO, and AUTO VCLs are made warm when the child is not
      running (which it is not at the time the startup VCLs are compiled), this
      ensures that it is a warm VCL that is selected as the active VCL.
      
      With this patch, VCLs loaded through the use of an initial CLI command
      script (-I option) will not cause a VCL to automatically be selected as
      the active VCL. Rather, it is expected that the initial CLI command script
      should have an explicit 'vcl.use' statement to select the active VCL. When
      an active VCL is not set, attempts to start the child will fail, which
      again will fail the varnishd daemon startup (unless -d is given) with an
      error code.
      
      The behaviour prior to this patch when using -I, -f '' (empty field), -F
      or -d was not well defined. The first VCL loaded (either by -I startup CLI
      script or a CLI 'vcl.load' command) would become the active VCL, even if
      that VCL is loaded cold. That is an illegal state and would lead to
      asserts. It is also not very useful functionality, given the typical use
      case for -I is to set up VCL labels. Those require the tips of the VCL
      tree dependency graph to be loaded first, and then the VCLs that selects
      the label. This means that the active VCL will typically be the last VCL
      loaded, which then will require the use of a 'vcl.use' statement in the -I
      script anyways. This makes it an acceptable change of default behaviour
      that should not affect users.
      dda20238
    • Martin Blix Grydeland's avatar
      Change mgt_new_vcl() to return the newly compiled vclprog · a2c70c5e
      Martin Blix Grydeland authored
      mgt_new_vcl() now returns a pointer to the newly compiled VCL program, or
      NULL on failure.
      
      This also fixes a wrong return value used previously which would cause a
      "VCL compiled.\n" to be output to CLI when the child is not running even
      when the VCL compilation step failed.
      a2c70c5e
    • Martin Blix Grydeland's avatar
      Make mgt_has_vcl() return an error string · 506c452a
      Martin Blix Grydeland authored
      mgt_has_vcl() now returns an error string describing why it doesn't have a
      valid VCL.
      
      This is taken from #3711 by @bsdphk
      506c452a
    • Martin Blix Grydeland's avatar
      Rename active_vcl to mgt_vcl_active · 9228395e
      Martin Blix Grydeland authored
      It is very easy to confuse the child process' vcl_active and the
      management process' active_vcl variables.
      
      Rename mgt's active_vcl to mgt_vcl_active, following the naming scheme
      used elsewhere.
      9228395e
    • Martin Blix Grydeland's avatar
      Enforce invariant on vcl_active in the child process · d13663f5
      Martin Blix Grydeland authored
      Add a ASSERT_VCL_ACTIVE() macro that asserts that vcl_active either is
      NULL or points to a VCL that is warm.
      
      Sprinkle this macro in the various calls throughout the child process that
      are involved in VCL handling.
      
      Patch by: @alveelde
      d13663f5
    • AlveElde's avatar
      Do not select active VCL automatically in the child process · 4f9785ec
      AlveElde authored
      Do not select the first VCL present as the active VCL in the child
      process. Instead it should always use what the mgt process tells it
      through the explicit 'vcl.use' commands it will send.
      
      Previously, the child could select a cold VCL as the active VCL if that
      happened to be the first one present to it during restarts. This could
      lead to asserts as that is not an allowed state.
      4f9785ec
  10. 15 Nov, 2021 1 commit
  11. 08 Nov, 2021 2 commits