[6.0] 6676a61ee Add asserts to ensure the (hypothetical?) race in #2528 doesn't happen.
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:12 UTC 2018
commit 6676a61eec1a6de1a036083a89cc6423a87bc58b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Jun 13 07:35:00 2018 +0000
Add asserts to ensure the (hypothetical?) race in #2528 doesn't happen.
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 6da9156b1..552e3e35e 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -903,6 +903,10 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
while (stp != F_STP_DONE) {
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
assert(bo->fetch_objcore->boc->refcount >= 1);
+ if (bo->fetch_objcore->boc->state < BOS_REQ_DONE)
+ AN(bo->req);
+ else
+ AZ(bo->req);
switch (stp) {
#define FETCH_STEP(l, U, arg) \
case F_STP_##U: \
More information about the varnish-commit
mailing list