1. 30 Dec, 2019 6 commits
  2. 29 Dec, 2019 7 commits
  3. 27 Dec, 2019 5 commits
    • Dridi Boukelmoune's avatar
      Plug leaks caught by c80 with ASAN · 93686c6a
      Dridi Boukelmoune authored
      This is only a matter of leaving the acceptor loop to always free the
      poolsock before returning from the function. This was initially done in
      only one place out of three, with no room to exit the accept inner loop
      in the absence of an incoming connection.
      
      With this we may have everything in place to drop the drop_pools debug
      flag.
      
      Refs 656982a5
      Closes #3177
      93686c6a
    • Dridi Boukelmoune's avatar
      Plug memory leaks witnessed in varnishtest · 5a55b53a
      Dridi Boukelmoune authored
      For those that aren't leaked on purpose, that is...
      5a55b53a
    • Dridi Boukelmoune's avatar
      Restore previous VRT_AddDirector semantics · 00fa3c75
      Dridi Boukelmoune authored
      Upon failure, don't destroy the underlying director implementation. When
      the deletion code was split in c671bb66
      in order to be reused in 61529854, it
      mistakenly included the director implementation.
      
      Instead, it's really the caller's job to tear down the backend if it
      couldn't be added. Since vbe_destroy operates on a director, it is split
      in two to avoid reintroducing the previous "undo" code duplication.
      
      Refs #3176
      00fa3c75
    • Dridi Boukelmoune's avatar
      Remove the opportunistic COOLING check · cb6ef119
      Dridi Boukelmoune authored
      Otherwise at this point nothing is undone. And backend creation while a
      VCL is stuck in the COOLING state should be unlikely enough that we can
      assume the happy path by default.
      
      Refs #3176
      cb6ef119
    • Federico G. Schwindt's avatar
      No longer needed · 8c90b585
      Federico G. Schwindt authored
      Fixed in 7ff636dc.
      8c90b585
  4. 26 Dec, 2019 3 commits
    • Dridi Boukelmoune's avatar
      Plug minor leak · aeead7e7
      Dridi Boukelmoune authored
      aeead7e7
    • Dridi Boukelmoune's avatar
      Only let VRT_AddDirector undo a COOLING attempt · 07a09db9
      Dridi Boukelmoune authored
      When a VCL is in the COOLING state it is supposed to delete the director
      that was being added, but at the same time when a VBE backend fails to
      be added as a director it would also undo itself.
      
      This is in general a code path very hard to reach because either this
      happens in a worker and the opportunistic check always kicks in to hide
      the problem or this is done asynchronously (e.g. non-blocking lookups to
      create dynamic backends) and the race window is very small. In order to
      solve this the opportunistic check is skipped in VTC mode.
      
      The test coverage with vmod_debug is done synchronously to make things
      easier, but for this reason vbe_destroy can no longer expect to only run
      in the CLI thread.
      
      This is inspired by a similar patch by Martin for a different branch,
      since VRT_AddDirector deletes the backend upon failure, everything needs
      to be set up beforehand.
      
      We have to tolerate backend creation attempts in a COOLING VCL because
      in the asynchronous case the VCL temperature will change before COLD
      events are dispatched so there's no way to prevent a race.
      
      Closes #3176
      07a09db9
    • Dridi Boukelmoune's avatar
      Add coverage for backend creation in a cold VCL · f9b7f181
      Dridi Boukelmoune authored
      Refs #3176
      f9b7f181
  5. 24 Dec, 2019 3 commits
    • Guillaume Quintard's avatar
      [cci] better weekly handling · a4539949
      Guillaume Quintard authored
      if version is trunk, change it to the current date and add a flag file
      so that packages can be suffixed with -weekly/.weekly depending on the
      platform
      a4539949
    • Martin Blix Grydeland's avatar
      Add an assert that VRT_delete_backend is only called once · 08593cb9
      Martin Blix Grydeland authored
      VRT_delete_backend() sets be->cooled to non-zero as the only place where
      that is done. Assert that it is zero on entry as a check that
      VRT_delete_backend isn't called multiple times.
      08593cb9
    • Martin Blix Grydeland's avatar
      Set be->cooled while holding backends_mtx · bea2939c
      Martin Blix Grydeland authored
      Several functions (VBE_Poll and vbe_destroy) tests be->cooled == 0 to
      determine which of the two lists backends and cool_backends a specific
      instance currently lives on. If the flag is in the process of being
      changed, then the wrong list head may be used and will result in strange
      bugs.
      bea2939c
  6. 23 Dec, 2019 4 commits
  7. 21 Dec, 2019 1 commit
    • Nils Goroll's avatar
      demo and test use of the stringified session attributes · 7c4cdd48
      Nils Goroll authored
      While, in most of the code, we now use SA_*_ADDR and format the
      address/port when needed, for the client ip and port, there still exist
      formatted strings as session attributes.
      
      I recently came across this in a different context and wondered if we
      should remove these string session attributes, but as we use them multiple
      times for each request, that would only imply additional overhead for
      repeated string formatting.  So I think we should keep them for now,
      but we might want to consider to add to struct suckaddr optional
      formatted strings to avoid the duplicated formatting which already
      happens.
      
      This commit adds a regression test.
      
      Motivated by #3173
      7c4cdd48
  8. 20 Dec, 2019 7 commits
    • Dridi Boukelmoune's avatar
      Tweak SLT_Notice to better fit the VSL · 6a483b19
      Dridi Boukelmoune authored
      Martin entrusted me with those changes after I pointed out that [core]
      was not a great prefix considering that VSL records already have the
      notion of a prefix.
      
      I opted for:
      
      - an actionable "vsl:" prefix for core notice messages
      - a prefix naming scheme mapping to manual pages
      
      As a result I changed the documentation a bit.
      
      Better diff with --word-diff --ignore-all-space options.
      6a483b19
    • Guillaume Quintard's avatar
      513ae61b
    • Guillaume Quintard's avatar
      [cci] switch to py3-sphinx for alpine · cf7259b5
      Guillaume Quintard authored
      cf7259b5
    • Martin Blix Grydeland's avatar
      Log using SLT_Notice on condfetch streaming delay · 9bf8e871
      Martin Blix Grydeland authored
      Log a notice message when delaying a conditional fetch and the stale
      template object is still streaming.
      9bf8e871
    • Martin Blix Grydeland's avatar
      Add a SLT_Notice VSL tag · 4c5aba28
      Martin Blix Grydeland authored
      This VSL tag will be used for informational messages related to
      exceptional handling of requests.
      4c5aba28
    • Martin Blix Grydeland's avatar
      Conditional fetch wait for streaming stale object · 98dc20f4
      Martin Blix Grydeland authored
      Wait for the stale object to become fully fetched, so that we can catch
      fetch errors, before we unbusy the new object. This serves two
      purposes. First it helps with request coalescing, and stops long chains of
      IMS-updated short-TTL objects all streaming from a single slow body
      fetch. Second it makes sure that all the object attributes are complete
      when we copy them (this would be an issue for ie OA_GZIPBITS).
      
      This patch OBE's r01646.vtc, and slightly patches r01648.vtc to expect a
      503 instead of a 200 and a broken connection on the failing client.
      
      Fixes: #3089
      98dc20f4
    • Dridi Boukelmoune's avatar
      Avoid loose vocabulary around VCL sub · 17457b48
      Dridi Boukelmoune authored
      The code base and documentation refer to ``sub`` symbols as:
      
      - subroutines
      - functions
      - methods
      - procedures
      - callbacks
      
      This change focuses on always referring to them as subroutines in the
      documentation. During this documentation sweep, there were a lot of
      false positives since VCL, VMODs and HTTP also share that vocabulary
      and I may have missed false negatives, especially for generated bits
      of documentation.
      
      Some parts of the documentation were not touched on purpose: upgrade
      notes and changelogs of past releases, PHK random outbursts, etc.
      
      Now that the documentation is hopefully taken care of the same needs
      to happen in the code base, starting with user-facing error messages
      and then data structures names, function names etc.
      
      There will be however one exception. Anything referring to the scope
      of a subroutine, but being worded as if it referred to the subroutine
      itself will use scope instead.
      
      As this will touch a lot of code, it will be done incrementally, much
      like this change focused on non-generated documentation (and VCC files
      don't count as generated in this context).
      
      I also fixed RST formatting issues I noticed during my sweep.
      
      Better diff with the --word-diff --ignore-all-space options.
      17457b48
  9. 19 Dec, 2019 4 commits