]
Pedro Ruivo updated ISPN-5379:
------------------------------
Fix Version/s: 8.0.0.Final
(was: 7.2.0.Final)
Persistence with stringKeyedJdbcStore throwing
ConcurrentModificationException while adding data to cache
----------------------------------------------------------------------------------------------------------
Key: ISPN-5379
URL:
https://issues.jboss.org/browse/ISPN-5379
Project: Infinispan
Issue Type: Bug
Components: Core, Loaders and Stores
Affects Versions: 6.0.2.Final
Reporter: Dan Berindei
Assignee: Dan Berindei
Fix For: 8.0.0.Final
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?