aurora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauricio Garavaglia <mauriciogaravag...@gmail.com>
Subject ResourceBag Ordering violates general contract
Date Fri, 28 Jul 2017 20:07:23 GMT
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

Mauricio

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message