Description
At times with load ConcurrentModificationException is being seen in FileStore
Caused by: java.util.ConcurrentModificationException: null at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:953) at java.util.LinkedList$ListItr.next(LinkedList.java:886) at org.apache.jackrabbit.oak.plugins.segment.file.FileStore.loadSegment(FileStore.java:285) at org.apache.jackrabbit.oak.plugins.segment.AbstractStore.readSegment(AbstractStore.java:85) at org.apache.jackrabbit.oak.plugins.segment.Segment.getSegment(Segment.java:266) at org.apache.jackrabbit.oak.plugins.segment.Record.getSegment(Record.java:109) at org.apache.jackrabbit.oak.plugins.segment.BlockRecord.read(BlockRecord.java:52) at org.apache.jackrabbit.oak.plugins.segment.SegmentStream.read(SegmentStream.java:163) at com.google.common.io.ByteStreams.read(ByteStreams.java:828) at com.google.common.io.ByteStreams.readFully(ByteStreams.java:695) at org.apache.jackrabbit.oak.plugins.index.lucene.OakDirectory$OakIndexFile.loadBlob(OakDirectory.java:174)
Looking at the code of FileStore[1] in writeSegment call the list of data/bulk files gets modified. This method is marked as synchronized but other methods loadSegment are not synchronized. This might cause the iterators to fail. Probably using CopyOnWriteArrayList would help