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

fix: Skip missed executions if CronWorkflow schedule is changed. Fixes #7182 #7353

Merged
merged 6 commits into from
Dec 11, 2021

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Dec 7, 2021

Fixes #7182

Signed-off-by: Simon Behar simbeh7@gmail.com

Don't bother creating a PR until you've done this:

  • Run make pre-commit -B to fix codegen, lint, and commit message problems.

Create your PR as a draft.

  • Your PR needs to pass the required checks before it can be approved. If the check is not required (e.g. E2E tests) it
    does not need to pass.
  • Once required tests have passed, you can make it "Ready for review".
  • Say how how you tested your changes. If you changed the UI, attach screenshots.

Tips:

  • If changes were requested, and you've made them, then dismiss the review to get it looked at again.
  • Add you organization to USERS.md if you like.
  • You can ask for help!

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7 simster7 changed the title fix: Skip missed executions if CronWorkflow schedule is changed fix: Skip missed executions if CronWorkflow schedule is changed. Fixes #7182 Dec 7, 2021
Signed-off-by: Simon Behar <simbeh7@gmail.com>
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

this seems smart, more tests?

Signed-off-by: Simon Behar <simbeh7@gmail.com>
Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7
Copy link
Member Author

simster7 commented Dec 7, 2021

@alexec enhanced tests, they should no cover all expected behaviors

workflow/cron/operator.go Outdated Show resolved Hide resolved
Signed-off-by: Simon Behar <simbeh7@gmail.com>
@@ -34,6 +36,8 @@ const (
ReplaceConcurrent ConcurrencyPolicy = "Replace"
)

const annotationKeyLatestSchedule = workflow.CronWorkflowFullName + "/last-used-schedule"
Copy link
Member Author

Choose a reason for hiding this comment

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

Moving the label here was necessary to avoid import cycles. I believe this is okay because we have full accessor methods and the label is private... this way implementation of the "last used schedule" concept is completely abstracted.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe previous-schedule?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think last-used-schedule is more accurate. We're interested in the schedule that was last used to execute a workflow. This may or may not be the previous schedule.

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7 simster7 merged commit 9320408 into argoproj:master Dec 11, 2021
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
sarabala1979 pushed a commit that referenced this pull request Dec 15, 2021
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CronWorkflow gets scheduled on schedule change if new schedule is between current time and last schedule.
2 participants