-
Notifications
You must be signed in to change notification settings - Fork 40k
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
AWS: cache instances during service reload to avoid rate limiting on restart #26900
AWS: cache instances during service reload to avoid rate limiting on restart #26900
Conversation
@@ -2671,9 +2677,18 @@ func (a *AWSCloud) getInstancesByIDs(instanceIDs []*string) (map[string]*ec2.Ins | |||
return instancesByID, nil | |||
} | |||
|
|||
// Fetches instances by node names; returns an error if any cannot be found. | |||
// Fetches instances by node names; returns an error if any cannot be found. Input must be sorted. | |||
// This is implemented with a multi value filter on the node names, fetching the desired instances with a single query. | |||
func (a *AWSCloud) getInstancesByNodeNames(nodeNames []string) ([]*ec2.Instance, error) { |
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.
How about if we rename this getInstancesByNodeNamesCached
, and add a TODO to rationalize all the caching in 1.4?
I think having an instance cache is a good idea, but I'm not crazy about the idea of having this cached but the single-fetch not cached (inconsistency) and I'm worried about the safety of exposing the whole cached ec2.Instance object (I think it's safe now, but we're setting ourselves up for weird problems later).
I also think that you should just drop the requirement that nodeNames be sorted; I think we just create a sets.String instead (for reasons that will become even clearer in my next few notes!)
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.
Renamed, added TODO and used a sets.String.
71078a7
to
83a4010
Compare
LGTM (presuming tests pass) |
Sample edited logs with
|
a93014d
to
07e71f1
Compare
@k8s-bot test this issue: #IGNORE I can't get to the logs of the alleged failure. |
1 similar comment
@k8s-oncall what to do about the gcloud crashed: errno 11 problem? Is it a known issue? |
@k8s-bot test this issue: #IGNORE Franz Kafka has come back to life and taken over Jenkins/e2e. |
07e71f1
to
e29709d
Compare
See #27205 for the previous failure (docs were versioned to 1.4.0 and the comments in the generated protos did not match). I updated the commit description to drop the reference to the util/slice changes. I hope it won't drop the LGTM, even if I left the code itself alone... |
@k8s-bot test this issue: #IGNORE |
stderr: fatal: reference is not a tree: d9f43d34f8973045549a2cf48be0a3e3bdd913c9 WAT |
@k8s-bot test this issue: #IGNORE "I'm going slightly mad" |
@k8s-bot test this, issue: #IGNORE "Just very slightly mad" |
GCE e2e build/test passed for commit e29709d. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit e29709d. |
Automatic merge from submit-queue |
Fixes #25610 by reducing redundant calls to DescribeInstances()
Also move int/stringSlicesEqual from servicecontroller.go to pkg/util/slice