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

Initialize schedule lazily #801

Merged
merged 1 commit into from
Oct 18, 2019

Conversation

danielmitterdorfer
Copy link
Member

Previously, we have initialized the schedule eagerly when it was
created. Among the state of the schedule is the point in time when it
was started. However, as the schedule is not immediately executed after
creation, it is possible that the start timestamp is slightly off. This
is usually not a problem in practice but may cause test failures where
we use very short-lived schedules (one second in total).

With this commit we wrap the schedule (which is a generator) in a
handle. This handle is passed to the executor which can then lazily
initialize the schedule so the timestamp matches exactly the point in
time when the schedule is executed.

Closes #600

Previously, we have initialized the schedule eagerly when it was
created. Among the state of the schedule is the point in time when it
was started. However, as the schedule is not immediately executed after
creation, it is possible that the start timestamp is slightly off. This
is usually not a problem in practice but may cause test failures where
we use very short-lived schedules (one second in total).

With this commit we wrap the schedule (which is a generator) in a
handle. This handle is passed to the executor which can then lazily
initialize the schedule so the timestamp matches exactly the point in
time when the schedule is executed.

Closes elastic#600
@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 Oct 18, 2019
@danielmitterdorfer danielmitterdorfer added this to the 1.4.0 milestone Oct 18, 2019
@danielmitterdorfer danielmitterdorfer self-assigned this Oct 18, 2019
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM.

The solution here makes sense as per the description in #600.

Unfortunately I couldn't reproduce the original failure in identical CI workers, but verified this PR passes all tests as well.

@danielmitterdorfer danielmitterdorfer merged commit 0aee2cf into elastic:master Oct 18, 2019
@danielmitterdorfer
Copy link
Member Author

Thanks!

@danielmitterdorfer danielmitterdorfer deleted the lazy-schedule branch October 18, 2019 09:21
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.

Start time-based schedules lazily
2 participants