During testing of PR #154 we noticed that the floating point math done in the AggregatedOffers logic can lead to incorrectly accounting for the resources used. e.g., with CPUs available being 4.1 and then having a worker need 1.1 CPUs, the subtraction lead to the CPUs being 2.9999999999999996 instead of 3.0 as expected. [1]
Effect?
The effect of this will be a failure to squeeze every bit of resources out of a set of Offers.
Implementation Options
Switch from Double/double to one of these fixed-point implementations:
Problem Description
During testing of PR #154 we noticed that the floating point math done in the AggregatedOffers logic can lead to incorrectly accounting for the resources used. e.g., with CPUs available being 4.1 and then having a worker need 1.1 CPUs, the subtraction lead to the CPUs being 2.9999999999999996 instead of 3.0 as expected. [1]
Effect?
The effect of this will be a failure to squeeze every bit of resources out of a set of Offers.
Implementation Options
Switch from Double/double to one of these fixed-point implementations:
Appendix
[1] Specifically, this value is the "bad" one:
CreateMesosWorkerSlot()
'saggregatedOffers.availableResources[0].value.totalAvailableResource
.