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

Treat some zero target-intervals as unthrottled #1124

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we adjust the predicate that considers a task as
unthrottled. Previously a task was unthrottled if and only if its target
throughput property was not defined and there was also not schedule set.
This lead to problems when a target-interval of zero was set on task
with an explicitly defined schedule (such as poisson). Now we treat
tasks as unthrottled if and only if the target throughput property is
not defined and the schedule is either unspecified or one of the
built-in schedules. This ensures that a target-interval of zero is
recognized as unthrottled for all built-in schedulers.

Closes #1120

With this commit we adjust the predicate that considers a task as
unthrottled. Previously a task was unthrottled if and only if its target
throughput property was not defined and there was also not schedule set.
This lead to problems when a target-interval of zero was set on task
with an explicitly defined schedule (such as poisson). Now we treat
tasks as unthrottled if and only if the target throughput property is
not defined and the schedule is either unspecified or one of the
built-in schedules. This ensures that a target-interval of zero is
recognized as unthrottled for all built-in schedulers.

Closes elastic#1120
@danielmitterdorfer danielmitterdorfer added bug Something's wrong :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc. labels Nov 24, 2020
@danielmitterdorfer danielmitterdorfer added this to the 2.0.3 milestone Nov 24, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this Nov 24, 2020
Copy link
Contributor

@hub-cap hub-cap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this bug!

def test_task_with_scheduler_is_throttled(self):
task = self.task(schedule="daily-traffic-pattern")
def test_target_interval_zero_treated_as_unthrottled(self):
task = self.task(target_interval=0)
self.assertIsNone(task.target_throughput)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

@danielmitterdorfer danielmitterdorfer merged commit bbca756 into elastic:master Nov 24, 2020
@danielmitterdorfer danielmitterdorfer deleted the refine-throttle branch November 24, 2020 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnitAwareScheduler does not support target_interval
2 participants