-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-38932][runtime] Fix incorrect scheduled timestamp in ProcessingTimeCallback with scheduleWithFixedDelay #27429
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: master
Are you sure you want to change the base?
Conversation
|
@Zakelly @xiangforever2014 Would you mind taking a look? |
…gTimeCallback with scheduleWithFixedDelay
| ProcessingTimeCallback callback, long initialDelay, long period, boolean fixedDelay) { | ||
| final long nextTimestamp = getCurrentProcessingTime() + initialDelay; | ||
| final Runnable task = wrapOnTimerCallback(callback, nextTimestamp, period); | ||
| final Runnable task = wrapOnTimerCallback(callback, nextTimestamp, period, fixedDelay); |
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.
Please could you add a test for this change
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.
Sure
| ProcessingTimeCallback callback, long initialDelay, long period, boolean fixedDelay) { | ||
| final long nextTimestamp = getCurrentProcessingTime() + initialDelay; | ||
| final Runnable task = wrapOnTimerCallback(callback, nextTimestamp, period); | ||
| final Runnable task = wrapOnTimerCallback(callback, nextTimestamp, period, fixedDelay); |
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 am checking the logic on the first time - I would expect the initial delay to take effect, then subsequent time the fixed delay. As the code is written the first time we get the initial plus the fixed delay, can you confirm this is what you want?
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.
The initial delay is accounted when calling scheduleRepeatedly, where nextTimestamp is initialized to getCurrentProcessingTime() + initialDelay
What is the purpose of the change
Fix incorrect scheduled timestamp in ProcessingTimeCallback with scheduleWithFixedDelay.
Verifying this change
This change is a trivial rework.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation