Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bandaid EventProgress logical error #392

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

linkous8
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Jan 12, 2022

ENG-404 Servox Measure runs indefinitely when duration is set to 0

Initially reported by @eric

This appears to be caused by the implementation of EventProgress used by the measure connector. See trace of aberrant logic below:

  • Prometheus measure creates an EventProgress with the control duration of 0: 
    measurement_duration = servo.Duration(control.warmup + control.duration)
    self.logger.info(
    f"Measuring {len(metrics__)} metrics for {measurement_duration}: {servo.utilities.join_to_series(measuring_names)}"
    )
    # Handle eager metrics
    eager_metrics = list(filter(lambda m: m.eager, metrics__))
    eager_settlement = max(eager_metrics, key=operator.attrgetter("eager")).eager if eager_metrics else None
    eager_observer = EagerMetricObserver(base_url=self.config.base_url, metrics=eager_metrics, start=start, end=end)
    if eager_metrics:
    servo.logger.info(f"Observing values of {len(eager_metrics)} eager metrics: measurement will return after {eager_settlement} of stability")
    else:
    servo.logger.debug(f"No eager metrics found: measurement will proceed for full duration of {measurement_duration}")
    # Allow the maximum settlement time of eager metrics to elapse before eager return (None runs full duration)
    progress = servo.EventProgress(timeout=measurement_duration, settlement=eager_settlement)
  • EventProgress.watch loops infinitely until the finished property returns true: https://github.com/opsani/servox/blob/main/servo/types.py#L309-L314
  • EventProgress.finished returns true when timed_out is true progress >= 100: 
    return self.timed_out or super().finished
  • EventProgress.timed_out always returns false if timeout is falsey: 
    if not self.timeout or not self.started: return False
  • EventProgress.progress always returns 0 if timeout is falsey which is the case with a duration of 0: 
    return 0.0

@linkous8 linkous8 merged commit f6d1e6f into main Jan 19, 2022
@linkous8 linkous8 deleted the fred/eng-404-servox-measure-runs-indefinitely-when branch January 19, 2022 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants