[8.19] Support rrule for task scheduling (#217728)#220657
Merged
ersin-erdal merged 3 commits intoelastic:8.19from May 14, 2025
Merged
[8.19] Support rrule for task scheduling (#217728)#220657ersin-erdal merged 3 commits intoelastic:8.19from
ersin-erdal merged 3 commits intoelastic:8.19from
Conversation
Resolves: elastic#216308 This PR adds rrule notation support to the task scheduling. Currently we use a simple interval string (such as `1h` or `45m`) to calculate the next `runAt` that we use to decide if the task should be picked up or not. With this PR, we will be able to use rrule as well. We set the `runAt` field in 3 places: - At task creation: when the task is created for the first time, this is always `now` if a specific runAt is not provided. - At task update. We update runAt on task update as well but only when it is provided. We don't update it when the schedule config changes. - After task run: to decide when the next run will be after a task is run. This PR modifies: - At task creation: It still uses the `runAt` when it is provided but calculates a runAt by using rrule if the config has a fixed time (like every day at 13:00) config. Becausethe task should not run immediately when there is a fixed time to run. - After task run: It calculates the next `runAt` with rrule when it is provided. This PR doesn't apply any change on `At task update` as it requires a further investigation and consideration. We will handle it with a follow-on issue. You can use the test task `sampleRecurringTask` to test the feature. Just create a task with rrule in the schedule config. Then check the runAt field in the task SO to see if it is the expected datetime. Then run the task one more time and check the new `runAt` I also used the usage reporting task in the actions plugin to test the feature. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 0878a09)
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Public APIs missing exports
History
|
doakalexi
approved these changes
May 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation