[
https://issues.apache.org/jira/browse/CAMEL-19397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726914#comment-17726914
] Alexandru Neaţă commented on CAMEL-19397: ----------------------------------------- [~nfilotto] sorry for the duplicate, a lot of things changed for the better in the past week :D > SimpleLRUCache is not thread-safe > --------------------------------- > > Key: CAMEL-19397 > URL: https://issues.apache.org/jira/browse/CAMEL-19397 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 3.20.5, 4.0-M3 > Reporter: Alexandru Neaţă > Priority: Minor > > SimpleLRUCache is not thread-safe, but it is used in various multi-threaded > places. > Examples are several > [IdempotentRepository|https://github.com/apache/camel/blob/main/core/camel-api/src/main/java/org/apache/camel/spi/IdempotentRepository.java] > implementations as: > * > [MemoryIdempotentRepository|https://github.com/apache/camel/blob/main/core/camel-support/src/main/java/org/apache/camel/support/processor/idempotent/MemoryIdempotentRepository.java#L41] > * > [FileIdempotentRepository|https://github.com/apache/camel/blob/main/core/camel-support/src/main/java/org/apache/camel/support/processor/idempotent/FileIdempotentRepository.java#L93] > * > [KafkaIdempotentRepository|https://github.com/apache/camel/blob/camel-3.20.x/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java#L269] > The problem with these is that the size limit of the cache is not respected > (we have a memory leak). > To reproduce the bug, the following sample project can be used: > [https://github.com/alex-nt/issues-java/tree/main/camel/kafka-idempotent] > Discussion about the issue can be read here: > [https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/Kafka.20idempotent.20Repository.20not.20threadsafe] -- This message was sent by Atlassian Jira (v8.20.10#820010)
