[master] 44d4609 Don't unbusy failed objects, it is pointless and introduces a race.

Poul-Henning Kamp phk at FreeBSD.org
Mon Mar 17 10:46:40 CET 2014


commit 44d46093dd34b4db102964a49bc90d7039f65db2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Mar 17 09:46:22 2014 +0000

    Don't unbusy failed objects, it is pointless and introduces a race.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index b5cb463..2f5bb9c 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -683,8 +683,6 @@ vbf_stp_fail(struct worker *wrk, struct busyobj *bo)
 
 	assert(bo->state < BOS_FINISHED);
 	HSH_Fail(bo->fetch_objcore);
-	if (bo->fetch_objcore->flags & OC_F_BUSY)
-		HSH_Unbusy(&wrk->stats, bo->fetch_objcore);
 	wrk->stats.fetch_failed++;
 	VBO_setstate(bo, BOS_FAILED);
 	return (F_STP_DONE);
@@ -738,9 +736,6 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
 	}
 	assert(WRW_IsReleased(wrk));
 
-	AZ(bo->fetch_objcore->flags & OC_F_BUSY);
-	HSH_Complete(bo->fetch_objcore);
-
 	bo->stats = NULL;
 
 	if (bo->vbc != NULL) {
@@ -756,6 +751,7 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
 
 	if (bo->state == BOS_FINISHED) {
 		assert(!(bo->fetch_objcore->flags & OC_F_FAILED));
+		HSH_Complete(bo->fetch_objcore);
 		VSLb(bo->vsl, SLT_Length, "%zd", bo->fetch_obj->len);
 		{
 		/* Sanity check fetch methods accounting */



More information about the varnish-commit mailing list