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

pranav commented on FINERACT-2822:
----------------------------------

Hi Abdalrahman, thanks for your interest. I am currently working on this issue 
and have already started implementing the fix and regression test. I will open 
a pull request shortly. Thanks!

> Prevent concurrent modification of supported cache names
> --------------------------------------------------------
>
>                 Key: FINERACT-2822
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2822
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: pranav
>            Priority: Minor
>
> SpotBugs 4.9.3 reports a potential concurrency issue in
> SpecifiedCacheSupportingCacheManager after the JDK upgrade from JDK 17 to JDK 
> 25.
> The supportedCacheNames field is a LinkedHashSet that can be accessed
> concurrently.
> setSupportedCaches() modifies the set while getCacheNames() exposes a
> collection backed by the same set. Concurrent iteration and modification
> can result in ConcurrentModificationException and unsafe concurrent access.
> The implementation should synchronize access to supportedCacheNames and
> return a snapshot from getCacheNames() so callers cannot iterate over the
> internally mutable set while it is being modified.
> A regression test should verify that concurrent reads and updates do not
> throw an exception.
> h3. Steps to reproduce
>  # Create a SpecifiedCachesSupportingCacheManager instance.
>  # Add initial supported cache names.
>  # Start one thread repeatedly calling getCacheNames() and iterating over
>  # Concurrently start another thread repeatedly calling setSupportedCaches()
>  # Concurrent iteration and modification can result in 
> ConcurrentModificationException



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to