1. 19 Aug, 2020 5 commits
    • Martin Blix Grydeland's avatar
      9bf79d4e
    • Martin Blix Grydeland's avatar
      Handle unformatable VCL_TIME to string conversion failures · 6cb9c766
      Martin Blix Grydeland authored
      For VCL_TIME values that would convert to a year element that can not fit
      in an int, gmtime_r would fail, and VTIM_format() would use random stack
      values when picking weekday and month strings.
      
      This patch changes VTIM_format to return "" when gmtime_r reports
      failures. This way the API is not changed. Callers can test for empty
      string to catch the failure if needed.
      
      VRT_TIME_string is patched to catch the VTIM_format error, and return NULL
      on failure.
      
      Fixes: #3308
      6cb9c766
    • Nils Goroll's avatar
      A request body now might have up to two references · 0644d58a
      Nils Goroll authored
      since d4b6228e the busyobj might also
      gain one, so depending on who deref's first, there may be one or zero
      references left.
      0644d58a
    • Martin Blix Grydeland's avatar
      Fetch thread reference count and keep cached request bodies · bb9d7d6f
      Martin Blix Grydeland authored
      With this patch fetch threads will for completely cached request bodies
      keep a reference to it for the entire duration of the fetch. This extends
      the retry window of backend requests with request body beyond the
      BOS_REQ_DONE point.
      
      Patch by: Poul-Henning Kamp
      bb9d7d6f
    • Martin Blix Grydeland's avatar
      Fail fetch retries when uncached request body has been released · a45e1f4e
      Martin Blix Grydeland authored
      Currently we allow fetch retries with body even after we have released the
      request that initiated the fetch, and the request body with it. The
      attached test case demonstrates this, where s2 on the retry attempt gets
      stuck waiting for 3 bytes of body data that is never sent.
      
      Fix this by keeping track of what the initial request body status was, and
      failing the retry attempt if the request was already released
      (BOS_REQ_DONE) and the request body was not cached.
      
      Conflicts:
          bin/varnishd/cache/cache.h
      a45e1f4e
  2. 18 Aug, 2020 1 commit
  3. 14 Aug, 2020 1 commit
  4. 16 Jun, 2020 10 commits
    • Nils Goroll's avatar
      respect `send_timeout` for "dripping" http1 writes · 62db2484
      Nils Goroll authored
      Previously, we only checked `v1l->deadline` (which gets initialized
      from the `send_timeout` session attribute or parameter) only for short
      writes, so for successful "dripping" http1 writes (streaming from a
      backend busy object with small chunks), we did not respect the
      timeout.
      
      This patch restructures `V1L_Flush()` to always check the deadline
      before a write by turning a `while() { ... }` into a `do { ... }
      while` with the same continuation criteria: `while (i != v1l->liov)`
      is turned into `if (i == v1l->liov) break;` and `while (i > 0 || errno
      == EWOULDBLOCK)` is kept to retry short writes.
      
      This also reduces the `writev()` call sites to one.
      
      Fixes #3189
      
       Conflicts:
      	bin/varnishd/http1/cache_http1_line.c
      	bin/varnishtest/tests/s00011.vtc
      62db2484
    • Poul-Henning Kamp's avatar
      Handle EWOULDBLOCK as a short write · b6a94a28
      Poul-Henning Kamp authored
      b6a94a28
    • Nils Goroll's avatar
      fix bereq rollback with retry · 893d1e69
      Nils Goroll authored
      When retrying after a rollback, we might have unread bytes of the
      backend response body. As we need to finalize the director for rollback,
      all we can do in this case is to close the connection.
      
      Spotted by reza, who also provided the test case, thank you.
      
      Closes #3353
      
       Conflicts:
              bin/varnishd/cache/cache_fetch.c
      893d1e69
    • Nils Goroll's avatar
      For rollback, NULL additional pointers which could point to workspace · 0b275eb7
      Nils Goroll authored
       Conflicts:
      	bin/varnishd/cache/cache_fetch.c
      	bin/varnishd/cache/cache_req.c
      0b275eb7
    • Nils Goroll's avatar
      integrate @rezan 's regression tests into m17.vtc · cb5a0747
      Nils Goroll authored
      I had previously overlooked that there exists a more complete regression
      test by him in #3010
      
      Integrate that vtc, polished and modified to account for the backend 503
      for no restart after rollback, into m17, making r3009 obsolete again
      cb5a0747
    • Nils Goroll's avatar
      Re-Setup the response after rollback · e0d24df4
      Nils Goroll authored
      Fixes #3083
      
      to get there, also centralize req->resp setup for deliver and synth:
      
      No semantic changes other than some reordering, which also fixes an odd
      log line ordering as shown by the change to c00018.vtc
      
       Conflicts:
      	bin/varnishd/cache/cache_req_fsm.c
      e0d24df4
    • Nils Goroll's avatar
      fix bereq rollback · 62b0192a
      Nils Goroll authored
      by properly cleaning up the busyobj
      
      Also move the relevant code from cache_vrt.c to cache_fetch.c
      
      As we fini the director during cleanup, we now also need to handle the
      backend connection gone missing in vbf_stp_fetch(). The hypothetical
      alternative would be to not fini the director, but I believe this is not
      safe in case it also used some workspace.
      
      Fixes #3009
      
       Conflicts:
      	bin/varnishd/cache/cache_fetch.c
      	bin/varnishd/cache/cache_varnishd.h
      	bin/varnishd/cache/cache_vrt.c
      62b0192a
    • Nils Goroll's avatar
      add test case by @rezan · f5a875a0
      Nils Goroll authored
      f5a875a0
    • Nils Goroll's avatar
      centralize cleanup after fetch errors · 7b40b80d
      Nils Goroll authored
      imples the following changes:
      
      * VDI_Finish() is now always conditional on bo->director_state !=
        DIR_S_NULL, making it idempotent
      
      * introduces additional calls to VFP_Close() from startfetch and
        for the filter_list / VCL_StackVFP error in vbf_stp_fetch(),
        but VFP_Close() is idempotent.
      
      * adds VFP_Close() for VFP_Open() failure in vbf_stp_fetch() which
        I think is actually missing (for the case that some VFPs could
        get opened before the open failure)
      
      * calls VDI_Finish() earlier in vbf_stp_fetchend: I checked the
        code and can not see any issue with this.
      
      motivated by #3009
      
       Conflicts:
      	bin/varnishd/cache/cache_fetch.c
      7b40b80d
    • Nils Goroll's avatar
      make VFP_Close() idempotent · 2d666b03
      Nils Goroll authored
      required for #3009
      2d666b03
  5. 02 Jun, 2020 2 commits
  6. 27 May, 2020 1 commit
    • Dridi Boukelmoune's avatar
      Revert "Formally expose VSB_tofile in libvarnishapi" · fc774933
      Dridi Boukelmoune authored
      This reverts commit 79536662.
      
      It shouldn't be exposed in libvarnishapi the way it is in this change
      because it creates two diverging symbol versions (for systems with
      linker support for symbol versioning) without changing the soname,
      which of course we want to avoid in the first place in a stable branch.
      
      If the requirement comes up we can revisit this topic and ensure both
      binary stability and compatility (upgrade path).
      
      Refs #3268
      fc774933
  7. 25 May, 2020 3 commits
  8. 21 May, 2020 3 commits
  9. 20 May, 2020 10 commits
  10. 19 May, 2020 4 commits