mirror of https://github.com/linkerd/linkerd2.git
The router's cache has no means to evict unused entries when capacity is reached. This change does the following: - Wraps cache values in a smart pointer that tracks the last time of access for each entry. The smart pointer updates the access time when the reference to entry is dropped. - When capacity is not available, all nodes that have not been accessed within some minimal idle age are dropped. Accesses and updates to the map are O(1) when capacity is available. Reclaiming capacity is O(n), so it's expected that the router is configured with enough capacity such that capacity need not be reclaimed usually. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |