You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2014/02/28 15:45:19 UTC

[jira] [Created] (OAK-1482) ConcurrentModificationException in FileStore

Chetan Mehrotra created OAK-1482:
------------------------------------

             Summary: ConcurrentModificationException in FileStore
                 Key: OAK-1482
                 URL: https://issues.apache.org/jira/browse/OAK-1482
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: core
    Affects Versions: 0.17.1
            Reporter: Chetan Mehrotra
            Assignee: Jukka Zitting


At times with load ConcurrentModificationException is being seen in FileStore

{noformat}
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)
{noformat}

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

https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java#L301



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)