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

FSLeafQueue can throw ConcurrentModificationException

    XMLWordPrintableJSON

Details

    • 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. YARN-2910.patch
          1 kB
          wilfreds#1
        2. FSLeafQueue_concurrent_exception.txt
          5 kB
          wilfreds#1
        3. YARN-2910.1.patch
          9 kB
          wilfreds#1
        4. YARN-2910.2.patch
          9 kB
          Karthik Kambatla
        5. YARN-2910.3.patch
          10 kB
          Akira Ajisaka
        6. YARN-2910.004.patch
          10 kB
          Ray Chiang
        7. YARN-2910.4.patch
          12 kB
          wilfreds#1
        8. YARN-2910.5.patch
          11 kB
          wilfreds#1
        9. YARN-2910.6.patch
          14 kB
          wilfreds#1
        10. YARN-2910.7.patch
          14 kB
          wilfreds#1
        11. YARN-2910.8.patch
          14 kB
          wilfreds#1

        Issue Links

          Activity

            People

              wilfreds Wilfred Spiegelenburg
              wilfreds Wilfred Spiegelenburg
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: