-
Notifications
You must be signed in to change notification settings - Fork 112
[9/N][VQueues] Ensure the scheduler's internal clock wheel is synchronized with eligibility_at #4057
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
base: main
Are you sure you want to change the base?
Conversation
8095323 to
d494555
Compare
…nized with eligibility_at This changeset makes sure that we have a reliable datum point that's shared between the delayed queue internal timer wheel and the scheduler. Additionally, it ensures that the scheduler can create `Instant` values that are synchronized with the datum point acquired from UniqueTimestamp. This fixes the issue introduced in changeset 6e65909 where we would become eligible slightly before the actual eligibility time, causing supurious rescheduling.
tillrohrmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for fixing the handling of delayed invocations @AhmedSoliman. The changes look good to me. I had a question about the need to set the start value of the DelayQueue explicitly.
| // Makes sure we use the same clock datum for the internal timer wheel and for our | ||
| // own eligibility checks. | ||
| let start = datum.origin_instant(); | ||
| let delayed_eligibility = DelayQueue::new(start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand why it is strictly required that the DelayQueue has the same start as the datum.origin_instant(). It seems as if the DelayQueue uses the start value for calculating offsets for internal purposes.
Isn't it enough that we are using the same clock (Tokio's) and insert_at and reset_at with concrete instants instead of durations to make the scheduling work reliably? Or differently asked, what would not work if we didn't set the start value of the DelayQueue.
This changeset makes sure that we have a reliable datum point that's shared between the delayed queue internal timer wheel and the scheduler.
Additionally, it ensures that the scheduler can create
Instantvalues that are synchronized with the datum point acquired from UniqueTimestamp.This fixes the issue introduced in changeset 6e65909 where we would become eligible slightly before the actual eligibility time, causing supurious rescheduling.
Stack created with Sapling. Best reviewed with ReviewStack.