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: cron flow for canaries #1109

Merged
merged 6 commits into from
Jul 3, 2023
Merged

fix: cron flow for canaries #1109

merged 6 commits into from
Jul 3, 2023

Conversation

yashmehrotra
Copy link
Member

Fixes: #1105

entry = findCronEntry(canary)
if entry != nil && time.Until(entry.Next) < 1*time.Hour {
// run all regular canaries on startup
// Run canary on startup
Copy link
Member

Choose a reason for hiding this comment

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

Run all regularly scheduled canaries on startup (<1h) and not daily/weekly schedules

if entry != nil && time.Until(entry.Next) < 1*time.Hour {
// run all regular canaries on startup
//Run all regularly scheduled canaries on startup (<1h) and not daily/weekly schedules
if entry != nil && time.Until(entry.Next) < 1*time.Hour && !exists {
Copy link
Member

Choose a reason for hiding this comment

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

Is this condition ever satisfied? If the cron entry is not nil, then the update time will also exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

have updated the code to modify entry

if entry != nil && time.Until(entry.Next) < 1*time.Hour {
// run all regular canaries on startup
//Run all regularly scheduled canaries on startup (<1h) and not daily/weekly schedules
if entry != nil && time.Until(entry.Next) < 1*time.Hour && !exists {
job = entry.Job.(CanaryJob)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this line?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, from a ux perspective if I add a check that runs every 15 minutes I don't want to wait for 15m to see if it worked

Copy link
Member

Choose a reason for hiding this comment

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

@moshloop I meant just this one line

job = entry.Job.(CanaryJob)

if err != nil {
return fmt.Errorf("failed to schedule canary %s/%s: %v", canary.Namespace, canary.Name, err)
}
*entry = CanaryScheduler.Entry(entryID)
Copy link
Member

Choose a reason for hiding this comment

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

This panics in the first run when the entry var is nil.

Copy link
Member

Choose a reason for hiding this comment

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

@moshloop moshloop merged commit 304a7ab into master Jul 3, 2023
11 checks passed
@yashmehrotra yashmehrotra deleted the fix-canary-cron branch July 4, 2023 04:46
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.

The max canary schedule currently possible is 2 minutes.
3 participants