Tested on:
v0.0.0-20240523143319-7d9f48f8ab91
How to reproduce:
- create a cache middleware using the memory adapter with a size of X
- Make an initial request with a response of size 2X
What happens:
- HTTP response never happens and CPU goes to 100%
Code trail:
in adapter/memory/memory.go:136 there is a for loop that will call evict until a.storage.shouldEvict(len(response)) is false, however if the cache is empty or if the response is larger than the cache size the loop will never exit because the evict call will never do anything.