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

Support retries on first commit #713

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

samrabelachew
Copy link
Contributor

@samrabelachew samrabelachew commented Jul 17, 2023

We originally required retries to only be allowed on the same revision as the last attempted deploy to prevent accidental reverts in history. However, there is an edge case where the first deployment on a root needs a retry. When it's the first deployment, the commit direction will always default to DirectionAhead instead of DirectionIdentical so we need to handle that scenario separately.

This change is technically a non-deterministic change (very unlikely to occur, as it's a rare scenario) so I've protected the rollout with versioning. While doing this, I also went ahead and cleaned up old versions in the Deploy workflow that are no longer relevant.

Comment on lines -204 to -215
v := workflow.GetVersion(ctx, AddNotifierVersion, workflow.DefaultVersion, workflow.Version(2))

var notifierPeriod time.Duration
if v == workflow.Version(1) {
notifierPeriod = r.NotifierPeriod(ctx, QueueStatusNotifierHourPST)
} else if v == workflow.Version(2) {
notifierPeriod = r.NotifierPeriod(ctx, QueueStatusNotifierHourUTC)
}

if v > workflow.DefaultVersion {
s.AddTimeout(ctx, notifierPeriod, notifyTimerFunc)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When deciding to remove this versions, do we first check if their are any running workflows that are still active on the older version, in this case version 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes that's correct

@samrabelachew samrabelachew merged commit 268ec39 into main Jul 25, 2023
2 checks passed
@samrabelachew samrabelachew deleted the fix-retries-on-first-deployment branch July 25, 2023 21:23
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.

2 participants