[master] a95525a Remove an almost correct assert.

Poul-Henning Kamp phk at FreeBSD.org
Thu Feb 27 11:03:01 CET 2014


commit a95525aff978039148712306134ad60d9b9c0b67
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Feb 27 10:01:11 2014 +0000

    Remove an almost correct assert.
    
    The real condition is that either there is no busyobj or it is in
    state BOS_FINISHED, being rapidly dismantled.
    
    The locking of testing that would be to complex and expensive so we
    eliminate the assert instead, and strengthen another busyobj related
    check a little bit in compensation.
    
    Fixes #1440

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index d6b43ae..db1c7a1 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -244,9 +244,10 @@ VBO_waitlen(struct busyobj *bo, ssize_t l)
 void
 VBO_setstate(struct busyobj *bo, enum busyobj_state_e next)
 {
-	Lck_Lock(&bo->mtx);
-	VSLb(bo->vsl, SLT_Debug, "XXX BOS: %d -> %d", bo->state, next);
+	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
+	assert(bo->do_stream || next != BOS_STREAM);
 	assert(next > bo->state);
+	Lck_Lock(&bo->mtx);
 	bo->state = next;
 	AZ(pthread_cond_broadcast(&bo->cond));
 	Lck_Unlock(&bo->mtx);
diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 2c681d6..c9f373a 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -294,7 +294,6 @@ V1D_Deliver(struct req *req)
 	if (!req->wantbody) {
 		/* This was a HEAD or conditional request */
 	} else if (req->res_mode & RES_ESI) {
-		AZ(req->obj->objcore->busyobj);
 		ESI_Deliver(req);
 	} else if (req->res_mode & RES_ESI_CHILD && req->gzip_resp) {
 		while (req->obj->objcore->busyobj)



More information about the varnish-commit mailing list