[master] ed7b310 Only attempt to salvage an object into Transient if it wasn't already destined for Transient in the first place.

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 25 12:33:25 CET 2014


commit ed7b3105e82ff289d0ee8132fcacac0dd7cfe645
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 19 08:05:59 2014 +0000

    Only attempt to salvage an object into Transient if it wasn't already
    destined for Transient in the first place.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 51cb160..661d802 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -107,14 +107,9 @@ vbf_bereq2obj(struct worker *wrk, struct busyobj *bo)
 	bo->stats = &wrk->stats;
 	AN(bo->fetch_objcore);
 	obj = STV_NewObject(bo, bo->storage_hint, l, nhttp);
-#if 0
-	// XXX: we shouldn't retry if we're already on Transient
 	if (obj == NULL &&
 	    (bo->storage_hint == NULL ||
 	    strcmp(bo->storage_hint, TRANSIENT_STORAGE))) {
-#else
-	if (obj == NULL) {
-#endif
 		/*
 		 * Try to salvage the transaction by allocating a
 		 * shortlived object on Transient storage.
@@ -316,7 +311,7 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo)
 	if (i) {
 		AZ(bo->vbc);
 		return (F_STP_ERROR);
-	} 
+	}
 
 	AN(bo->vbc);
 	http_VSL_log(bo->beresp);
diff --git a/bin/varnishtest/tests/r01284.vtc b/bin/varnishtest/tests/r01284.vtc
index 697f104..6299926 100644
--- a/bin/varnishtest/tests/r01284.vtc
+++ b/bin/varnishtest/tests/r01284.vtc
@@ -36,8 +36,8 @@ client c1 {
 	delay 1
 } -run
 
-# Two failures, one for obj2 and two for the attempts at sending error
-varnish v1 -expect SMA.Transient.c_fail == 3
+# Two failures, one for obj2 and one for the attempts at sending error
+varnish v1 -expect SMA.Transient.c_fail == 2
 
 client c1 {
 	# Check that Varnish is still alive



More information about the varnish-commit mailing list