Details
Description
There is a problem in DynamicEndpointSnitch.java in sortByProximityWithBadness()
Before calling sortByProximityWithScore we comparing each nodes score ratios to the badness threshold.
if ((first - next) / first > BADNESS_THRESHOLD) { sortByProximityWithScore(address, addresses); return; }
This is not always the correct comparison because first score can be less than next score and in that case we will compare a negative number with positive.
The solution is to compute absolute value of the ratio:
if (Math.abs((first - next) / first) > BADNESS_THRESHOLD)
This issue causing an incorrect sorting of DCs based on their performance and affects performance of the snitch.
Thanks.