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

Duplicate API calls (describe-subnets) in cluster build #73

Open
KashifSaadat opened this issue Jun 28, 2017 · 1 comment
Open

Duplicate API calls (describe-subnets) in cluster build #73

KashifSaadat opened this issue Jun 28, 2017 · 1 comment

Comments

@KashifSaadat
Copy link
Contributor

KashifSaadat commented Jun 28, 2017

The addition of logging has highlighted duplication of certain API calls. On creating a full cluster (master & compute nodes), the describe-subnets ec2 API is called a minimum of 4 times (can increase depending on the amount of compute pools defined). Additionally, on building computepool0 the call to the API passes 5 subnets when only 3 were initially defined (2 ids were duplicated).

Example Logs:

[debug] 2017/06/28 09:50:55 aws.go:699: describing a list of subnets [subnet-XXXXXX01 subnet-XXXXXX02 subnet-XXXXXX03]
[debug] 2017/06/28 09:50:55 aws.go:707: received subnets description: [3 subnet objects]
..
[debug] 2017/06/28 09:52:01 aws.go:699: describing a list of subnets [subnet-XXXXXX01 subnet-XXXXXX01 subnet-XXXXXX02 subnet-XXXXXX02 subnet-XXXXXX03]
[debug] 2017/06/28 09:52:01 aws.go:707: received subnets description: [3 subnet objects]

The providers could potentially have a method of maintaining a local cache for certain API calls, so if the same subnet IDs are passed the details can be returned immediately.

Is there any case where the data may change mid build, requiring a re-fetch?

@vaijab
Copy link
Contributor

vaijab commented Jun 28, 2017

I am aware of this. This code bit could definitely be optimized. They are not entirely duplicate calls, they happen at different times for different components, but sure, some runtime state could help to minimize cloud API calls.

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

No branches or pull requests

2 participants