Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-2910

FSLeafQueue can throw ConcurrentModificationException

    Details

    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      The list that maintains the runnable and the non runnable apps are a standard ArrayList but there is no guarantee that it will only be manipulated by one thread in the system. This can lead to the following exception:

      2014-11-12 02:29:01,169 ERROR [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: ERROR IN CONTACTING RM.
      java.util.ConcurrentModificationException: java.util.ConcurrentModificationException
      at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
      at java.util.ArrayList$Itr.next(ArrayList.java:831)
      at org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSLeafQueue.getResourceUsage(FSLeafQueue.java:147)
      at org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSAppAttempt.getHeadroom(FSAppAttempt.java:180)
      at org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler.allocate(FairScheduler.java:923)
      at org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService.allocate(ApplicationMasterService.java:516)
      

      Full stack trace in the attached file.

      We should guard against that by using a thread safe version from java.util.concurrent.CopyOnWriteArrayList

        Attachments

        1. FSLeafQueue_concurrent_exception.txt
          5 kB
          Wilfred Spiegelenburg
        2. YARN-2910.004.patch
          10 kB
          Ray Chiang
        3. YARN-2910.1.patch
          9 kB
          Wilfred Spiegelenburg
        4. YARN-2910.2.patch
          9 kB
          Karthik Kambatla
        5. YARN-2910.3.patch
          10 kB
          Akira Ajisaka
        6. YARN-2910.4.patch
          12 kB
          Wilfred Spiegelenburg
        7. YARN-2910.5.patch
          11 kB
          Wilfred Spiegelenburg
        8. YARN-2910.6.patch
          14 kB
          Wilfred Spiegelenburg
        9. YARN-2910.7.patch
          14 kB
          Wilfred Spiegelenburg
        10. YARN-2910.8.patch
          14 kB
          Wilfred Spiegelenburg
        11. YARN-2910.patch
          1 kB
          Wilfred Spiegelenburg

          Issue Links

            Activity

              People

              • Assignee:
                wilfreds Wilfred Spiegelenburg
                Reporter:
                wilfreds Wilfred Spiegelenburg
              • Votes:
                0 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: