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
mock_Request.go
mock_Type.go
request.go
testing.go
type.go
watch.go
watch_test.go