[master] 0375791 Start using our new "busy" criteria for objcores
Poul-Henning Kamp
phk at FreeBSD.org
Thu Jan 28 12:49:20 CET 2016
commit 0375791cac1f2333ab54932ba1d2025261082fab
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Jan 21 10:22:00 2016 +0000
Start using our new "busy" criteria for objcores
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 96f1f7a..d75178a 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -398,8 +398,9 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
if (oc->flags & OC_F_FAILED)
continue;
- if (oc->flags & OC_F_BUSY) {
+ if (oc->boc != NULL && oc->boc->state < BOS_STREAM) {
CHECK_OBJ_ORNULL(oc->boc, BOC_MAGIC);
+
if (req->hash_ignore_busy)
continue;
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 365c482..19f3797 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -203,7 +203,9 @@ cnt_deliver(struct worker *wrk, struct req *req)
HSH_DerefBusy(wrk, req->objcore);
boc = NULL;
} else if (!boc->busyobj->do_stream) {
- ObjWaitState(boc, BOS_FINISHED);
+ /* XXX These should go away */
+ xxxassert(boc->state >= BOS_STREAM);
+ xxxassert(boc->state >= BOS_FINISHED);
HSH_DerefBusy(wrk, req->objcore);
boc = NULL;
}
diff --git a/bin/varnishtest/tests/c00013.vtc b/bin/varnishtest/tests/c00013.vtc
index 689e118..70eedad 100644
--- a/bin/varnishtest/tests/c00013.vtc
+++ b/bin/varnishtest/tests/c00013.vtc
@@ -43,5 +43,5 @@ client c2 {
client c1 -wait
-varnish v1 -expect busy_sleep == 1
-varnish v1 -expect busy_wakeup == 1
+varnish v1 -expect busy_sleep >= 1
+varnish v1 -expect busy_wakeup >= 1
More information about the varnish-commit
mailing list