Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11274

ConcurrentModificationException in Configuration Copy Constructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • None
    • None
    • conf
    • None

    Description

      Exception as below happens in doing some configuration update in parallel:

      java.util.ConcurrentModificationException
      	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:922)
      	at java.util.HashMap$EntryIterator.next(HashMap.java:962)
      	at java.util.HashMap$EntryIterator.next(HashMap.java:960)
      	at java.util.HashMap.putAllForCreate(HashMap.java:554)
      	at java.util.HashMap.<init>(HashMap.java:298)
      	at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:703)
      

      In a constructor of Configuration - public Configuration(Configuration other), the copy of updatingResource data structure in copy constructor is not synchronized properly.
      Configuration.get() eventually calls loadProperty() where updatingResource gets updated. So, whats happening here is one thread is trying to do copy of Configuration as demonstrated in stack trace and other thread is doing Configuration.get(key) and than ConcurrentModificationException occurs because copying of updatingResource is not synchronized in constructor.
      We should make the update to updatingResource get synchronized, and also fix other tiny synchronized issues there.

      Attachments

        1. HADOOP-11274-v4.patch
          5 kB
          Vinod Kumar Vavilapalli
        2. HADOOP-11274-v3.patch
          4 kB
          Vinod Kumar Vavilapalli
        3. HADOOP-11274-v2.patch
          5 kB
          Junping Du
        4. HADOOP-11274.patch
          2 kB
          Junping Du
        5. HADOOP-11274.003.patch
          5 kB
          Jing Zhao

        Issue Links

          Activity

            People

              vinodkv Vinod Kumar Vavilapalli
              junping_du Junping Du
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: