Objects for ESI includes incorrectly miss (Solved / Patch)

JT Justman jt at endpoint.com
Tue May 20 18:45:01 CEST 2008


JT Justman wrote:
> Hi, everyone. I've been doing my best to dig into the bug I opened:
> 
> http://varnish.projects.linpro.no/ticket/240
> 
> Basically, every object is inserted, but the second and subsiquent 
> objects always miss.

I have found the cause for the bug, and a potential fix.

In cache_hash.c function HSH_Lookup, there is a ttl check:

if (o->ttl >= sp->t_req)

This test passes on the first ESI and fails on the others. Debugging 
shows that the ttl is correct, but t_req is NAN. It seems that t_req is 
cleared, and needs to be reset somewhere in ESI or the step flow.

My solution is to set sp->t_req = TIM_real() in ESI_Deliver. (See patch).

Not being intimate with the program flow or timing, I don't know what 
other implications this could have. Suggestions?

JT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cache_vrt_esi-jt_2008-05-20.patch
Type: text/x-diff
Size: 410 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20080520/1c5d35a8/attachment-0003.patch>


More information about the varnish-dev mailing list