Permalink
Browse files

Clarify and test object slimming for hfp+hfm

The previous code was correct already, but we can make it
clearer that HFP implies OC_F_PASS

Also test explicitly that both HFM and HFP have their objects
slimmed.

Closes #2768
  • Loading branch information...
nigoroll committed Sep 7, 2018
1 parent aa89308 commit 6788ed48a04f183916c0b6f1647d4c106ec1af9c
Showing with 22 additions and 6 deletions.
  1. +3 −1 bin/varnishd/cache/cache_req_fsm.c
  2. +19 −5 bin/varnishtest/tests/r01821.vtc
@@ -417,7 +417,9 @@ cnt_transmit(struct worker *wrk, struct req *req)
VSLb_ts_req(req, "Resp", W_TIM_real(wrk));
if (req->objcore->flags & (OC_F_PRIVATE | OC_F_PASS)) {
if (req->objcore->flags & (OC_F_PRIVATE | OC_F_PASS | OC_F_HFP)) {
if (req->objcore->flags & OC_F_HFP)
AN(req->objcore->flags & OC_F_PASS);
if (boc != NULL) {
HSH_Abandon(req->objcore);
ObjWaitState(req->objcore, BOS_FINISHED);
@@ -1,4 +1,6 @@
varnishtest "Slim down hit-for-miss objects"
varnishtest "Slim down hit-for-miss / hit-for-miss objects"
# see also #2768
server s1 -repeat 2 {
rxreq
@@ -7,20 +9,32 @@ server s1 -repeat 2 {
varnish v1 -arg "-s Transient=default" -vcl+backend {
sub vcl_backend_response {
set beresp.uncacheable = true;
if (bereq.url == "/hfm") {
set beresp.uncacheable = true;
} else if (bereq.url == "/hfp") {
return (pass(1m));
}
}
} -start
logexpect l1 -v v1 {
logexpect l1 -v v1 -g raw {
expect * * Storage "Transient"
expect * * Storage "Transient"
} -start
client c1 {
txreq
txreq -url "/hfm"
rxresp
} -start
client c2 {
txreq -url "/hfp"
rxresp
} -run
client c1 -wait
logexpect l1 -wait
varnish v1 -expect SM?.Transient.c_bytes != 0
varnish v1 -expect SM?.Transient.c_bytes > 131072
varnish v1 -expect SM?.Transient.g_bytes < 65536

0 comments on commit 6788ed4

Please sign in to comment.