Uploaded image for project: 'Apache Gora'
  1. Apache Gora
  2. GORA-210

thread safety: java.util.ConcurrentModificationException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.2
    • Fix Version/s: 0.3
    • Component/s: gora-cassandra
    • Labels:
    • Environment:

      Description

      This is the result of debugging one of my issues described in NUTCH-1534.
      I think there is a wrong assumpation about thread safety of LinkedHashMap, it is not enough to not iterate over the buffer (which is a LinkedHashMap).
      My patch fixes this error for me:

      java.util.ConcurrentModificationException
      at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:394)
      at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:405)
      at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
      at org.apache.gora.cassandra.store.CassandraStore.flush(CassandraStore.java:200)
      at org.apache.gora.mapreduce.GoraRecordWriter.write(GoraRecordWriter.java:65)
      at org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.write(ReduceTask.java:587)
      at org.apache.hadoop.mapreduce.TaskInputOutputContext.write(TaskInputOutputContext.java:80)
      at org.apache.nutch.fetcher.FetcherReducer$FetcherThread.output(FetcherReducer.java:664)
      at org.apache.nutch.fetcher.FetcherReducer$FetcherThread.run(FetcherReducer.java:534)

      It may not be perfect from a performance point of view...

        Attachments

        1. GORA-210-trunk.patch
          1 kB
          Roland von Herget
        2. GORA-210.patch
          1 kB
          Roland von Herget

          Issue Links

            Activity

              People

              • Assignee:
                rherget Roland von Herget
                Reporter:
                rherget Roland von Herget
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: