• Pål Hermunn Johansen's avatar
    Fix problem with purging and the n_obj_purged counter · c21fae9a
    Pål Hermunn Johansen authored
    When the do..while loop in HSH_Purge executes on a oh with many
    popular variants, there is a potential problem with the "array" of oc
    pointers, allocated in the thread workspace. If many of the oc's have
    positive refcounts, they will fill up the array and
    
    	EXP_Rearm(oc, now, ttl, grace, keep);
    	(void)HSH_DerefObjCore(wrk, &oc, 0);
    
    will be called several on the same oc's. At the same time, the counter
    n_obj_purged will be updated with a too low number.
    
    The test case demonstrates how we get a too low value for this counter,
    but it is not able to force varnishd to use a siginificant amount of CPU.
    c21fae9a
r02372.vtc 569 Bytes