Permalink
Browse files

Add a reminder TODO to fix case where aggregator returns nil for HA

  • Loading branch information...
1 parent ba7b4c4 commit bd0fcd9aa966db7e92e7405b4c58e89c972adca9 @oldpatricka oldpatricka committed Mar 22, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 epu/highavailability/policy.py
@@ -487,6 +487,10 @@ def apply_policy(self, all_procs, managed_upids):
try:
average_metric = sum(values) / len(values)
except ZeroDivisionError:
+ # TODO: this is really boneheaded. What we should do instead is
+ # treat this situation specifically to scale to the minimum.
+ # Users might want a metric that can go negative for example,
+ # and this trick won't work
average_metric = 0
if average_metric > self._parameters['scale_up_threshold']:
scale_by = self._parameters['scale_up_n_processes']

0 comments on commit bd0fcd9

Please sign in to comment.