open-consul/agent/cache
Paul Banks b61e00b772
cache: fix bug where TTLs were ignored leading to leaked memory in client agents (#9978)
* Fix bug in cache where TTLs are effectively ignored

This mostly affects streaming since streaming will immediately return from Fetch calls when the state is Closed on eviction which causes the race condition every time.

However this also affects all other cache types if the fetch call happens to return between the eviction and then next time around the Get loop by any client.

There is a separate bug that allows cache items to be evicted even when there are active clients which is the trigger here.

* Add changelog entry

* Update .changelog/9978.txt
2021-04-08 11:08:56 +01:00
..
cache.go cache: fix bug where TTLs were ignored leading to leaked memory in client agents (#9978) 2021-04-08 11:08:56 +01:00
cache_test.go cache: fix bug where TTLs were ignored leading to leaked memory in client agents (#9978) 2021-04-08 11:08:56 +01:00
entry.go lib/ttlcache: extract package from agent/cache 2020-10-20 19:10:20 -04:00
mock_Request.go
mock_Type.go
request.go
testing.go Decrease test flakiness 2020-08-24 20:30:02 +01:00
type.go agent/cache: Use AllowNotModifiedResponse in CatalogListServices 2020-07-14 18:58:20 -04:00
watch.go cache: log a warning when Cache.Notify handles an error 2021-02-12 13:02:23 -05:00
watch_test.go testing: skip slow tests with -short 2020-12-07 13:42:55 -05:00