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(traffic guards): avoid server group lookup #3788

Merged
merged 2 commits into from
Jul 2, 2020

Conversation

cfieber
Copy link
Contributor

@cfieber cfieber commented Jul 1, 2020

On verifyInstanceTermination, short circuit checks for
server group instance state if there are no enabled
traffic guards for the server group

On verifyInstanceTermination, short circuit checks for
server group instance state if there are no enabled
traffic guards for the server group
@@ -231,7 +260,8 @@ public void verifyTrafficRemoval(
TargetServerGroup someServerGroup = serverGroupsGoingAway.stream().findAny().get();
Location location = someServerGroup.getLocation();

if (!hasDisableLock(someServerGroup.getMoniker(), account, location)) {
Front50Cache front50Cache = new Front50Cache(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't creating a new cache here defeat some of the cache benefit vs passing it in from line 248?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the intent of the cache is it should just live through one public call path through TrafficGuard, so this one is at the start of one of the public verifyTrafficRemoval signatures that eventually calls the same verifyTrafficRemovalInternal as line 248 is calling

There was one case where (for instance termination) the entrypoint from one public method was calling into another public method so that is where I introduced a private method that allows propagating the cache along

Copy link
Contributor

@marchello2000 marchello2000 left a comment

Choose a reason for hiding this comment

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

a question/comment otherwise lgtm

@cfieber cfieber added the ready to merge Approved and ready for merge label Jul 2, 2020
@mergify mergify bot added the auto merged Merged automatically by a bot label Jul 2, 2020
@mergify mergify bot merged commit e1968aa into spinnaker:master Jul 2, 2020
KathrynLewis pushed a commit to KathrynLewis/orca that referenced this pull request Jan 31, 2021
On verifyInstanceTermination, short circuit checks for
server group instance state if there are no enabled
traffic guards for the server group

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.22
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants