Uploaded image for project: 'Aurora'
  1. Aurora
  2. AURORA-1943

PreemptionVictimFilter does not handle varied ResourceTypes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.19.0
    • Scheduler
    • None

    Description

      Reported by Mauricio Garavaglia on the dev list:

      Hi guys,

      There seems to be a bug in this comparator in PreemptionVictimFilter (
      https://github.com/apache/aurora/blob/master/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptionVictimFilter.java#L142)
      because the comparator doesn’t satisfy transitivity, which is required by
      Array.sort's Tim Sort implementation. This fails with a
      "java.lang.IllegalArgumentException: Comparison method violates its general
      contract!" from time to time.

      For example this input of A, B, and C doesn't work in the current
      comparator.

      A: <1, 1, 1>
      B: <2, 2, 2>
      C: <0, 2, 1>

      Based on the comparator:

      B > A
      B == C
      C == A

      Constructs impossible situation where C == B > A == C. As a workaround we
      patched to simply sort based on RAM, but anyone have any suggestions about
      what a permanent fix for upstream should be? Thanks

      A likely culprit is that the filter does not handle comparison of tasks containing different ResourceTypes.

      Attachments

        Issue Links

          Activity

            People

              wfarner Bill Farner
              wfarner Bill Farner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: