nic-6443 commented on PR #14061:
URL: https://github.com/apache/apisix/pull/14061#issuecomment-6356642331

   @membphis thanks, both findings reproduced against the real gateway, and 
I've reworked the PR in 5d1d17e instead of patching the resource-keyed design.
   
   The cache is back to master's URL-keyed lrucache (same key, count, TTL, 
stale serving, refresh and serial creation). What's new is an opt-in `inactive` 
option in `core.lrucache`: it records each key's last access on hits and sets, 
and a single per-worker purge timer, separate from the refresh timer, deletes 
keys not accessed within `inactive` and drops their pending refresh. 
oas-validator uses `inactive = spec_url_ttl`.
   
   For P1 #1, there is only one reference per URL again, so a refresh releases 
the previous generation for every resource, and a URL nobody uses is released 
after `spec_url_ttl`. TEST 27 runs your scenario: one compiled spec left after 
the refreshes, zero once the URL goes idle. For P1 #2, the 512 limit counts 
URLs again and resources don't own entries, so resource churn can't evict a 
fresh spec. TEST 29 runs 600 routes over 51 URLs and the second pass makes zero 
fetches, same as master.
   
   Deletion is by access time only, so an entry still being requested is kept 
even if its refresh keeps failing. A refresh that's in flight when its entry is 
purged doesn't write it back. Both are covered in `t/core/lrucache.t`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to