Repository navigation
fix(workflows): align nextFire interval calculation with dispatcher clock (#2788) - #2799
Open
isihussain wants to merge 1 commit into
Open
isihussain wants to merge 1 commit into
isihussain wants to merge 1 commit into
Conversation
…lock (danielmiessler#2788) For interval triggers, nextFire previously computed lastStart + period, drifting whenever runs started off-grid or with tick latency. The dispatcher fires on multiples of the period counted from the Unix epoch via occurrencesIn/occurrencesBetween. Update nextFire interval case to query occurrencesBetween for the next epoch-grid occurrence, ensuring workflow next and the dispatcher agree. Add schedule.next.test.ts covering off-grid and tick latency scenarios. Closes danielmiessler#2788 Signed-off-by: isihussain <isihussain@users.noreply.github.com>
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.
Summary
Fixes #2788.
For an interval trigger, workflow next and the dispatcher previously computed different fire times:
extFire, interval case).
This caused workflow next to diverge whenever a run started with latency or off-grid (e.g. reporting 23:45Z when the dispatcher fires at 00:00Z).
Solution
extFire in LIFEOS/WORKFLOWS/engine/schedule.ts (interval case) to query occurrencesBetween for the next epoch-grid occurrence, aligning it directly with the dispatcher's clock.
Signed-off-by: isihussain isihussain@users.noreply.github.com