Summary: | infinitive loop of AH01323: Purge of LDAP cache failed | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Hendrik Harms <hendrik.harms> |
Component: | mod_ldap | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | covener |
Priority: | P2 | Keywords: | FixedInTrunk, PatchAvailable |
Version: | 2.4.27 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Attachments: | mod_ldap TTL patch |
Description
Hendrik Harms
2017-12-11 15:19:18 UTC
Created attachment 35608 [details]
mod_ldap TTL patch
We have a TTL-time for each cache. So why don't use it for recalculating the best marktime before purging.
A small example to make the issue more clear: Imagine we have a cache that could store 20 items -> maxentries=20 and the TTL for the items is 10 seconds. markentries = maxentries*3/4 = 15 We have 11 power users sending a request every 5 seconds We have 20 lazy users sending a request once a minute (average 1 per 5 seconds) We start with an empty cache at 0 sec at 5 sec 12 items a taken (11 power + 1 lazy) at 20 sec 15 items a taken (11 power + 4 lazy) -> markentries reatched -> set marktime = 20 at 45 sec 20 items a taken (11 power + 9 lazy) at 50 sec a new lazy entry should be added into the cache but cache is full -> a purge starts The purge could only delete the 4 lazy entries older than marktime cause the power entries are already renewed. (TTL=10) So we left with 16 entries in our cache. 16 is greater than 15 ! So we never set a new marktime and all following purges could not delete any item. -> bang -> AH01323 Thank for the report, patch, and followup (it helped). I committed the patch with minor changes r1818040 and have proposed it for backport to 2.4.x. Backported in 2.4.x in r1820800 This is part of 2.4.30 released with 2.4.33 - THX |