-
Notifications
You must be signed in to change notification settings - Fork 19
Don't pass AllowNoPollers=true when unsetting current and ramping version #746
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
base: main
Are you sure you want to change the base?
Changes from all commits
bae8f8f
471eb19
3c7c05e
b99fa70
6e64ec9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,12 @@ var Feature = harness.Feature{ | |
| } | ||
| return run, nil | ||
| }, | ||
| StartWorkflowOptionsMutator: func(o *client.StartWorkflowOptions) { | ||
| // I observed this complete in 2 minutes 55 seconds when there were many Deployments | ||
| // to delete. If the deletions are happening frequently, this will likely be shorter. | ||
| // Giving a long timeout here to make sure it doesn't cause flakiness. | ||
| o.WorkflowExecutionTimeout = 5 * time.Minute | ||
| }, | ||
| } | ||
|
|
||
| func CleanOldDeployments(ctx workflow.Context) (string, error) { | ||
|
|
@@ -60,10 +66,6 @@ func ListOldDeployments(ctx context.Context) ([]string, error) { | |
| allDeployments = append(allDeployments, deployment.Name) | ||
| } | ||
| } | ||
|
|
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
Comment on lines
-63
to
-66
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. err was always nil here, so this was not doing anything |
||
| return allDeployments, nil | ||
| } | ||
|
|
||
|
|
@@ -87,44 +89,17 @@ func DeleteDeployment(ctx context.Context, deploymentName string) error { | |
| DeploymentName: deploymentName, | ||
| Identity: "feature-deployment-deleter", | ||
| IgnoreMissingTaskQueues: true, | ||
| AllowNoPollers: true, | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the change that actually avoided the error |
||
| }) | ||
| if err != nil { | ||
| // Try using unversioned string (needed if deployment was very old) | ||
| _, err = client.WorkflowService().SetWorkerDeploymentCurrentVersion(ctx, &workflowservice.SetWorkerDeploymentCurrentVersionRequest{ | ||
| Namespace: ns, | ||
| DeploymentName: deploymentName, | ||
| Version: "__unversioned__", | ||
| BuildId: "__unversioned__", | ||
| Identity: "feature-deployment-deleter", | ||
| IgnoreMissingTaskQueues: true, | ||
| AllowNoPollers: true, | ||
| }) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to unset current version for deployment %s: %w", deploymentName, err) | ||
| } | ||
|
Comment on lines
-93
to
-105
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this code is just not needed anymore, because all of the deployments in this test environment are new |
||
| return fmt.Errorf("failed to unset current version for deployment %s: %w", deploymentName, err) | ||
| } | ||
| _, err = client.WorkflowService().SetWorkerDeploymentRampingVersion(ctx, &workflowservice.SetWorkerDeploymentRampingVersionRequest{ | ||
| Namespace: ns, | ||
| DeploymentName: deploymentName, | ||
| Identity: "feature-deployment-deleter", | ||
| IgnoreMissingTaskQueues: true, | ||
| AllowNoPollers: true, | ||
| }) | ||
| if err != nil { | ||
| // Try using unversioned string (needed if deployment was very old) | ||
| _, err = client.WorkflowService().SetWorkerDeploymentRampingVersion(ctx, &workflowservice.SetWorkerDeploymentRampingVersionRequest{ | ||
| Namespace: ns, | ||
| DeploymentName: deploymentName, | ||
| Version: "__unversioned__", | ||
| BuildId: "__unversioned__", | ||
| Identity: "feature-deployment-deleter", | ||
| IgnoreMissingTaskQueues: true, | ||
| AllowNoPollers: true, | ||
| }) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to unset ramping version for deployment %s: %w", deploymentName, err) | ||
| } | ||
| return fmt.Errorf("failed to unset ramping version for deployment %s: %w", deploymentName, err) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the next run completed in 279ms, so I think when there isn't much work to be done, this workflow completes quickly, but when there are many versions to delete, it takes a while. I think we should keep it at 5 minutes