Commit ad92c565 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Ignore req.ttl when keeping track of epired objects

The goal of `req.ttl` is to allow lower requirements for known
transactions (since this has to be done in VCL) but objects with
an age higher than `req.ttl` would always be considered expired
during lookup even if their actual TTL (obj.ttl) is still positive.

Ignoring `req.ttl` gives a better control over explicit refreshes
made to optimize latency and greatly reduces the risk of running
into #1799 (for a subset of use cases).

Refs #2422
parent 4f124446
......@@ -441,7 +441,8 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
*ocp = oc;
return (HSH_HIT);
}
if (oc->exp.t_origin > exp_t_origin) {
if (EXP_Ttl(NULL, &oc->exp) < req->t_req && /* ignore req.ttl */
oc->exp.t_origin > exp_t_origin) {
/* record the newest object */
exp_oc = oc;
exp_t_origin = oc->exp.t_origin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment