-
Bug
-
Resolution: Done
-
Major
-
6.0.2.Final
-
None
From Dennis Reed:
A ConcurrentModificationException in the CacheWriter interceptor during a commit.
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:953)
at java.util.LinkedList$ListItr.next(LinkedList.java:886)
at org.infinispan.interceptors.CacheWriterInterceptor.store(CacheWriterInterceptor.java:210)
at org.infinispan.interceptors.CacheWriterInterceptor.commitCommand(CacheWriterInterceptor.java:115)
The code is looping through the modifications associated with the transaction:
List<WriteCommand> modifications = ctx.getCacheTransaction().getAllModifications();
...
210: for (WriteCommand cacheCommand : modifications) {
The transaction's modification list is stored as a synchronized list with a comment "we need to synchronize this collection to be able to get a valid snapshot from another thread during state transfer".
But this thread is not doing state transfer, and I'd assume "get a valid snapshot" wouldn't include modification?
Is it valid for this list to be modified from another thread (in which case all iterations should be synchronized), or is something modifying it incorrectly?