You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be due to calculating the frequent and recent LRU sizes and being truncated to 0. So when those get created the following error is returned:
"Must provide a positive size"
Obviously this is really edge casey as who would want a cache of size 1 (except I did when implementing some unit tests for Consul).
The text was updated successfully, but these errors were encountered:
rsjethani
added a commit
to rsjethani/golang-lru
that referenced
this issue
Sep 1, 2019
For cases where the combination of 2Q size and ghostRatio result in
evict cache of size 0, the error message displayed to the user is
rather confusing.
This commit proposes to fix the code and give a suitable error message
to the user.
Addresses: Issue hashicorp#51
@mkeeler you are right this is an edge case. However the code is not wrong when it denies creation of a size 1 2Q cache. A size 1 2Q cache makes no sense.
But yes the code should give proper error message instead of the current confusing one. So here is a small change I have made via PR #60
This seems to be due to calculating the frequent and recent LRU sizes and being truncated to 0. So when those get created the following error is returned:
"Must provide a positive size"
Obviously this is really edge casey as who would want a cache of size 1 (except I did when implementing some unit tests for Consul).
The text was updated successfully, but these errors were encountered: