[master] 0ed12c4 Remove spurious assert on VCL release

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Sep 9 18:50:16 CEST 2016


commit 0ed12c403912afa5b96571809e51f75ed0fa4a35
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Aug 30 21:55:07 2016 +0200

    Remove spurious assert on VCL release

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 298423f..e5bb70e 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -510,8 +510,12 @@ VRT_rel_vcl(VRT_CTX, struct vclref **refp)
 	vcl = ctx->vcl;
 	CHECK_OBJ_NOTNULL(vcl, VCL_MAGIC);
 	assert(vcl == ref->vcl);
-	assert(vcl->temp == VCL_TEMP_WARM || vcl->temp == VCL_TEMP_BUSY ||
-	    vcl->temp == VCL_TEMP_COOLING);
+
+	/* NB: A VCL may be released by a VMOD at any time, but it must happen
+	 * after a warmup and before the end of a cooldown. The release may or
+	 * may not happen while the same thread holds the temperature lock, so
+	 * instead we check that all references are gone in VCL_Nuke.
+	 */
 
 	Lck_Lock(&vcl_mtx);
 	assert(!VTAILQ_EMPTY(&vcl->ref_list));



More information about the varnish-commit mailing list