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

efs_facts needs a way to gather a subset of facts due to API limits #36506

Closed
ryansb opened this issue Feb 21, 2018 · 5 comments
Closed

efs_facts needs a way to gather a subset of facts due to API limits #36506

ryansb opened this issue Feb 21, 2018 · 5 comments
Labels
affects_2.5 This issue/PR affects Ansible v2.5 aws cloud feature This issue/PR relates to a feature request. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@ryansb
Copy link
Contributor

ryansb commented Feb 21, 2018

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

efs_facts

ANSIBLE VERSION
Ansible 2.5
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A - only affects AWS module

SUMMARY

The AWS EFS API is heavily rate limited, leading to frequent throttle/retry cycles. Previously, these caused the efs_facts module to error out (per #36040). Now the module does take a long time to execute over many EFS shares, but does complete. It would be nice to have a set of arguments to reduce the number of API calls by excluding some data, such as security groups, that is less frequently used to make the normal usage of efs_facts faster.

Per comment on the more acute fix for the API limits: #36266 (comment)

Related: #36040

cc/ @ julienvey

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

@ansibot
Copy link
Contributor

ansibot commented Feb 21, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 21, 2018

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 aws cloud feature_idea module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:certified This issue/PR relates to certified code. labels Feb 21, 2018
@julienvey
Copy link
Contributor

Looking more closely at the code I now understand why it can sometimes take a lot of time.

The code looks like this

file_systems_info = connection.get_file_systems(fs_id, name)

if tags:
    file_systems_info = [item for item in file_systems_info if has_tags(item['tags'], tags)]

if targets:
    targets = [(item, prefix_to_attr(item)) for item in targets]
    file_systems_info = [item for item in file_systems_info if has_targets(item['mount_targets'], targets)]

What happen is:

  • List all EFS in the region and collect all information (including mount targets and security groups)
  • Then only, do the filtering if tags or targets is set

In my case, I wanted the facts about only 3 EFS (filtered by tag), but we have more than 100 in the same region, this is why it tooks so long to complete.

I'll try to propose a PR to improve this behaviour and limit the number of API calls

@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Feb 23, 2018
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ryansb
Copy link
Contributor Author

ryansb commented Mar 2, 2018

Thanks - I've left a review on the PR

@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:certified This issue/PR relates to certified code. labels Sep 19, 2018
@ryansb
Copy link
Contributor Author

ryansb commented Sep 19, 2018

Closed in 0f612d1

@ryansb ryansb closed this as completed Sep 19, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 aws cloud feature This issue/PR relates to a feature request. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

4 participants