Commit ca507177 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland Committed by Reza Naghibi

Log using SLT_Notice on condfetch streaming delay

Log a notice message when delaying a conditional fetch and the stale
template object is still streaming.

Conflicts:
    bin/varnishd/cache/cache_fetch.c
    doc/sphinx/reference/vsl.rst
parent bdbe85cf
......@@ -706,6 +706,34 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(bo->fetch_objcore, OBJCORE_MAGIC);
CHECK_OBJ_NOTNULL(bo->stale_oc, OBJCORE_MAGIC);
stale_boc = HSH_RefBoc(bo->stale_oc);
CHECK_OBJ_ORNULL(stale_boc, BOC_MAGIC);
if (stale_boc) {
/* 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 coalesching, 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). */
VSLb(bo->vsl, SLT_Notice,
"[core] Conditional fetch wait for streaming object");
ObjWaitState(bo->stale_oc, BOS_FINISHED);
stale_state = stale_boc->state;
HSH_DerefBoc(bo->wrk, bo->stale_oc);
stale_boc = NULL;
if (stale_state != BOS_FINISHED) {
(void)VFP_Error(bo->vfc, "Template object failed");
vbf_cleanup(bo);
wrk->stats->fetch_failed++;
return (F_STP_FAIL);
}
}
AZ(bo->stale_oc->flags & OC_F_FAILED);
AZ(vbf_beresp2obj(bo));
......
......@@ -102,6 +102,26 @@ Error
Backend request failed to vcl_backend_error.
NOTICE MESSAGES
===============
Notice messages contain informational messages about the handling of a
request. These can be exceptional circumstances encountered that causes
deviation from the normal handling. The messages are prefixed with [core]
for core Varnish generated messages, or with [<VMOD name>] for VMOD
generated messages. The [core] messages are described in detail below, see
the individual VMOD documentation for messages from VMODs.
[core] Conditional fetch wait for streaming object
The backend answered 304 Not Modified on a conditional fetch using
an object that has not yet been fully fetched as the stale
template object. This can only happen when the TTL of the object
is less than the time it takes to fetch it. The fetch is halted
until the stale object is fully fetched, upon which the new object
is created as normal. While waiting, any grace time on the stale
object will be in effect.
HISTORY
=======
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment