jodd icon indicating copy to clipboard operation
jodd copied to clipboard

LRUCache has Concurrency problem

Open looly opened this issue 3 years ago • 5 comments

Current behavior

Hello, I found the class: LRUCache

use LinkedHashMap and use read lock for get, but the LinkedHashMap get method is not thread safe, the element will move to last of queue when get it.

image

looly avatar Feb 17 '22 15:02 looly

True! the thing is that the cache utilities were not migrated to the https://github.com/oblac/jodd-util.

I am under impression that there are better cache libraries out there... not sure if we should maintain this one anymore?

igr avatar Feb 19 '22 10:02 igr

U means that cache will be removed next time?

looly avatar Feb 20 '22 17:02 looly

It already is :) If you take a look in the https://github.com/oblac/jodd-util there is no cache anymore...

But I am open for discussion!

igr avatar Feb 22 '22 04:02 igr

So, wdyt @looly ? Would such a small cache make sense?

igr avatar Feb 22 '22 04:02 igr

Un.... not sense.

I mean if some user use the old version jodd-all will be touch off the bug,and its very difficut to find out it.

looly avatar Feb 22 '22 14:02 looly