You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nicolas Filotto (Jira)" <ji...@apache.org> on 2023/05/28 10:40:00 UTC

[jira] [Comment Edited] (CAMEL-19397) SimpleLRUCache is not thread-safe

    [ https://issues.apache.org/jira/browse/CAMEL-19397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726917#comment-17726917 ] 

Nicolas Filotto edited comment on CAMEL-19397 at 5/28/23 10:39 AM:
-------------------------------------------------------------------

If you have the possibility to test your use case against the latest snapshot of 4 or 3.21 dependending on your context, and tell us how it went, it could be very helpful for us


was (Author: JIRAUSER285918):
If you have the possibility to test your use case against the latest snapshot of 4 or 3.21 dependending on your context, and tell us how it went, it could very helpful for us

> 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)