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

Ensure target server group after stages are added correctly #1170

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

robfletcher
Copy link
Contributor

Tactical fix for SPIN-2298

Because aroundStages is re-entrant but in the case of TargetServerGroupLinearStageSupport it also mutates the original stage context it was losing the additional regions. I would like to not have the method be re-entrant at all but this should fix things for now.

@@ -43,11 +43,6 @@ class ModifyAwsScalingProcessStage extends TargetServerGroupLinearStageSupport {
}

@Override
def <T extends Execution> List<Stage<T>> aroundStages(Stage<T> parentStage) {
return composeTargets(parentStage);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is redundant — it does exactly the same thing as in the superclass

@@ -36,8 +36,6 @@ class DestroyServerGroupStage extends TargetServerGroupLinearStageSupport {
@Override
<T extends Execution<T>> void taskGraph(Stage<T> stage, TaskNode.Builder builder) {
try {
composeTargets(stage)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was just cruft from long ago. It doesn't need to do this as part of the main stage as it's done in aroundStages

return composeTargets(parentStage)
}

@Memoized
Copy link
Contributor Author

@robfletcher robfletcher Feb 9, 2017

Choose a reason for hiding this comment

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

Makes the method safe to be re-entrant. What could go wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

📟

@@ -39,10 +40,11 @@ abstract class TargetServerGroupLinearStageSupport implements StageDefinitionBui
String name = this.type

@Override
def <T extends Execution> List<Stage<T>> aroundStages(Stage<T> parentStage) {
def <T extends Execution<T>> List<Stage<T>> aroundStages(Stage<T> parentStage) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Groovy and weird generic signature glitches.

Because `aroundStages` is re-entrant but in the case of TargetServerGroupLinearStageSupport it also mutates the original stage context it was losing the additional regions. I would like to not have the method be re-entrant at all but this should fix things for now.
@cfieber
Copy link
Contributor

cfieber commented Feb 9, 2017

fabulous, lets see what happens!

@robfletcher robfletcher merged commit a96ceb0 into spinnaker:master Feb 9, 2017
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