[master] 3ad34e875 Retire return(miss) from vcl_hit {}

Nils Goroll nils.goroll at uplex.de
Mon Mar 4 13:02:06 UTC 2019


commit 3ad34e8755c0c46a7b94fbc34ae4837e8c9a1ad5
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Dec 5 16:16:54 2018 +0100

    Retire return(miss) from vcl_hit {}
    
    Ref #1799

diff --git a/bin/varnishd/builtin.vcl b/bin/varnishd/builtin.vcl
index 4835a231c..ce4a5c445 100644
--- a/bin/varnishd/builtin.vcl
+++ b/bin/varnishd/builtin.vcl
@@ -96,17 +96,7 @@ sub vcl_purge {
 }
 
 sub vcl_hit {
-    if (obj.ttl >= 0s) {
-        // A pure unadulterated hit, deliver it
-        return (deliver);
-    }
-    if (obj.ttl + obj.grace > 0s) {
-        // Object is in grace, deliver it
-        // Automatically triggers a background fetch
-        return (deliver);
-    }
-    // fetch & deliver once we get the result
-    return (miss);
+    return (deliver);
 }
 
 sub vcl_miss {
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 1bd7911ee..2cbedfdf6 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -552,24 +552,6 @@ cnt_lookup(struct worker *wrk, struct req *req)
 			wrk->stats->cache_hit_grace++;
 		req->req_step = R_STP_DELIVER;
 		return (REQ_FSM_MORE);
-	case VCL_RET_MISS:
-		if (busy != NULL) {
-			req->objcore = busy;
-			req->stale_oc = oc;
-			req->req_step = R_STP_MISS;
-		} else {
-			(void)HSH_DerefObjCore(wrk, &req->objcore,
-			    HSH_RUSH_POLICY);
-			/*
-			 * We don't have a busy object, so treat this
-			 * like a pass
-			 */
-			VSLb(req->vsl, SLT_VCL_Error,
-			    "vcl_hit{} returns miss without busy object."
-			    "  Doing pass.");
-			req->req_step = R_STP_PASS;
-		}
-		return (REQ_FSM_MORE);
 	case VCL_RET_RESTART:
 		req->req_step = R_STP_RESTART;
 		break;
diff --git a/bin/varnishtest/tests/r01335.vtc b/bin/varnishtest/tests/r01335.vtc
deleted file mode 100644
index 1488c9822..000000000
--- a/bin/varnishtest/tests/r01335.vtc
+++ /dev/null
@@ -1,25 +0,0 @@
-varnishtest "#1335 fetch without busy object"
-
-server s1 {
-	rxreq
-	txresp -bodylen 5
-	rxreq
-	txresp -bodylen 6
-} -start
-
-varnish v1 -vcl+backend {
-	sub vcl_hit {
-		if (req.http.two == "2") {
-			return (miss);		// also #1603
-		}
-	}
-} -start
-
-client c1 {
-	txreq
-	rxresp
-} -run
-client c1 {
-	txreq -hdr "two: 2"
-	rxresp
-} -run
diff --git a/doc/graphviz/cache_req_fsm.dot b/doc/graphviz/cache_req_fsm.dot
index 629072dc5..bf777fdcd 100644
--- a/doc/graphviz/cache_req_fsm.dot
+++ b/doc/graphviz/cache_req_fsm.dot
@@ -133,7 +133,6 @@ digraph cache_req_fsm {
 	lookup:h:s -> lookup2 [style=bold,color=green]
 
 	lookup2:deliver:s -> deliver:n [style=bold,color=green]
-	lookup2:miss:s -> miss [color=blue,label=" #1799 \n EOL"]
 	lookup2:pass:s -> pass [style=bold,color=red]
 
 	/* cnt_miss */
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 5f7191f11..991c29ae6 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -115,7 +115,7 @@ returns = (
     ),
     ('hit',
      "C",
-     ('fail', 'synth', 'restart', 'pass', 'miss', 'deliver',)
+     ('fail', 'synth', 'restart', 'pass', 'deliver',)
     ),
     ('deliver',
      "C",


More information about the varnish-commit mailing list