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

FSParentQueue: Comparison method violates its general contract

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.2.0
    • fairscheduler
    • None
    • Reviewed

    Description

      The ResourceManager can fail while sorting queues if an update comes in:

      FATAL org.apache.hadoop.yarn.server.resourcemanager.ResourceManager: Error in handling event type NODE_UPDATE to the scheduler
      java.lang.IllegalArgumentException: Comparison method violates its general contract!
      	at java.util.TimSort.mergeLo(TimSort.java:777)
      	at java.util.TimSort.mergeAt(TimSort.java:514)
      ...
      	at java.util.Collections.sort(Collections.java:175)
      	at org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSParentQueue.assignContainer(FSParentQueue.java:223)

      The reason it breaks is a change in the sorted object itself. 
      This is why it fails:

      • an update from a node comes in as a heartbeat.
      • the update triggers a check to see if we can assign a container on the node.
      • walk over the queue hierarchy to find a queue to assign a container to: top down.
      • for each parent queue we sort the child queues in assignContainer to decide which queue to descent into.
      • we lock the parent queue when sort to prevent changes, but we do not lock the child queues that we are sorting.

      If during this sorting a different node update changes a child queue then we allow that. This means that the objects that we are trying to sort now might be out of order. That causes the issue with the comparator. The comparator itself is not broken.

      Attachments

        1. YARN-8436.001.patch
          8 kB
          wilfreds#1
        2. YARN-8436.002.patch
          8 kB
          wilfreds#1
        3. YARN-8436.003.patch
          8 kB
          wilfreds#1

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: