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

never allow drainage info to be nil if the version stopped accepting new workflows #7343

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

carlydf
Copy link
Contributor

@carlydf carlydf commented Feb 14, 2025

What changed?

Set version to DRAINING before starting child instead of relying on child's signal

Why?

How did you test it?

Potential risks

Documentation

Is hotfix candidate?

@carlydf carlydf requested a review from a team as a code owner February 14, 2025 02:55
d.syncSummary(ctx)
} else {
mergedInfo.Status = d.VersionState.DrainageInfo.Status
mergedInfo.LastChangedTime = d.VersionState.DrainageInfo.LastChangedTime
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should change the child wf to not send a singal at the beginning now? it's awkward for LastCheckedTime to change a few milliseconds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -233,6 +236,14 @@ func (d *VersionWorkflowRunner) handleUpdateVersionMetadata(ctx workflow.Context
}

func (d *VersionWorkflowRunner) startDrainage(ctx workflow.Context, isCan bool) {
if d.VersionState.GetDrainageInfo().GetStatus() == enumspb.VERSION_DRAINAGE_STATUS_UNSPECIFIED {
now := timestamppb.New(workflow.Now(ctx))
d.VersionState.DrainageInfo = &deploymentpb.VersionDrainageInfo{
Copy link
Collaborator

Choose a reason for hiding this comment

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

hopefully no logic depends on VersionState.DrainageInfo otherwise we have to patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember making sure that everything did VersionState.GetDrainageInfo().GetStatus() so it /should/ just say unspecified if it's nil due to the gap between child starting and signal arriving

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean workflow patch for NDE

@@ -62,17 +61,6 @@ func DrainageWorkflow(

// Set status = DRAINING and then sleep for visibilityGracePeriod (to let recently-started workflows arrive in visibility)
if !args.IsCan { // skip if resuming after the parent continued-as-new
parentWf := workflow.GetInfo(ctx).ParentWorkflowExecution
Copy link
Collaborator

Choose a reason for hiding this comment

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

you need a wf patch here

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