CAMEL-19295 - Concurrency issues with dynamicMap in AbstractDynamicRegistry - #9972
Conversation
Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
Signed-off-by: Rhuan Rocha <rhuan080@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 If necessary Apache Camel Committers may access logs and test results in the job summaries! |
|
Hi, I sent this PR and I have seen the SimpleLRUCache [1] is not thread-safe, and we don`t have a ConcurrentLinkedHashMap or something like that. Thus, I think we need to review this class to turn it thread-safe. Maybe an improvement in another issue? [1] - |
|
🚫 There are (likely) no components to be tested in this PR |
|
Yes we should look at SimpleLRUCache before 4.0, can you create a JIRA ticket |
I'm wondering if it would be possible to unify all these caches and pools that we have. For instance, we have the |
Yeah but ServicePool is a bit complex and special for camel's producer/consumer caches. |
|
We may just drop SimpleLRUCache and use camel-caffeine-lrucache by default, and maybe move it into root/core folder. This cache is concurrent and LRU based. However it has a slight overhead on startup, that Simple does not have. @otavioprado something you may have fun with performance testing in your lab. |
|
I did a quick experiment with fully sync LRUCache and this unit test It all works, but since its fully sync it may have an overhead. And we could make the simple just synchronized (but maybe slower). @otavioprado you are welcome to test in lab |
|
@davsclaus that's a good one to test. I'll write a test for it and will do it next week. Let's see how it goes! |
Description
Target
camel-3.x, whereas Camel 4 uses themainbranch)Tracking
Apache Camel coding standards and style
mvn -Pformat,fastinstall install && mvn -Psourcecheck