[master] 304683c Adopt Martins fixed for #1138, which is mostly an artifact of me being interrupted half-way through committing a bunch of stuff.

Poul-Henning Kamp phk at varnish-cache.org
Mon May 21 10:12:43 CEST 2012


commit 304683cc17f4bbf39fb6eb35443e40d2755867cd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 21 08:11:04 2012 +0000

    Adopt Martins fixed for #1138, which is mostly an artifact of me being
    interrupted half-way through committing a bunch of stuff.
    
    I'm passing on the test-case for two reasons: The code is in flux and
    it will soon be obsolete, and second "delay 0.2" testcases are notoriously
    flakey.
    
    Submitted by:	Martin
    Fixes		#1138

diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index b350438..d96bd8e 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -324,7 +324,7 @@ cnt_deliver(struct sess *sp, struct worker *wrk, struct req *req)
 		assert(bo->state >= BOS_FAILED);
 
 		if (bo->state == BOS_FAILED) {
-			req->obj = NULL;
+			HSH_Deref(&wrk->stats, NULL, &req->obj);
 			VBO_DerefBusyObj(wrk, &req->busyobj);
 			req->err_code = 503;
 			sp->step = STP_ERROR;
@@ -900,7 +900,7 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
 		VBO_DerefBusyObj(wrk, &req->busyobj);
 	} else if (bo->state == BOS_FAILED) {
 		/* handle early failures */
-		req->obj = NULL;
+		HSH_Deref(&wrk->stats, NULL, &req->obj);
 		VBO_DerefBusyObj(wrk, &req->busyobj);
 		req->err_code = 503;
 		sp->step = STP_ERROR;
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 7e9a25c..bc0e52c 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -645,8 +645,9 @@ FetchBody(struct worker *wrk, void *priv)
 	if (bo->state == BOS_FAILED) {
 		wrk->stats.fetch_failed++;
 		VDI_CloseFd(&bo->vbc);
-		obj->exp.ttl = -1.;
 		obj->len = 0;
+		EXP_Clr(&obj->exp);
+		EXP_Rearm(obj);
 	} else {
 		assert(bo->state == BOS_FETCHING);
 



More information about the varnish-commit mailing list