Skip to content

LRUCache has Concurrency problem #786

Open
@looly

Description

@looly

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

Activity

igr

igr commented on Feb 19, 2022

@igr
Member

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?

looly

looly commented on Feb 20, 2022

@looly
Author

U means that cache will be removed next time?

igr

igr commented on Feb 22, 2022

@igr
Member

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!

self-assigned this
on Feb 22, 2022
igr

igr commented on Feb 22, 2022

@igr
Member

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

looly

looly commented on Feb 22, 2022

@looly
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @looly@igr

      Issue actions

        LRUCache has Concurrency problem · Issue #786 · oblac/jodd