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

Add AWSRetry.jittered_backoff to rds_instance_info #1026

Conversation

kteague-tasktop
Copy link
Contributor

SUMMARY

Add AWSRetry.jittered_backoff to the rds_instance_info module.

When calling rds_instance_info we have been seeing API rate limit errors from AWS. When calling this module, it usually runs to about 90-150 times in a minute before we get rate limited.

Using jittered_backoff should significantly decrease the number of times we see API rate limits here.

02:20:36 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded
02:20:36 fatal: [polaris -> localhost]: FAILED! => {"boto3_version": "1.20.22", "botocore_version": "1.23.22", "changed": false, "error": {"code": "Throttling", "message": "Rate exceeded", "type": "Sender"}, "msg": "Couldn't get instance information: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded", "response_metadata": {"http_headers": {"connection": "close", "content-length": "254", "content-type": "text/xml", "date": "Tue, 15 Mar 2022 09:20:34 GMT", "x-amzn-requestid": "5de8131e-3f59-4b04-af25-5f7083ee09b9"}, "http_status_code": 400, "max_attempts_reached": true, "request_id": "5de8131e-3f59-4b04-af25-5f7083ee09b9", "retry_attempts": 4}}
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • rds_instance_info
ADDITIONAL INFORMATION

Decorated rds_instance_info with AWSRetry.jittered_backoff

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review traceback labels Mar 28, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@marknet15
Copy link
Contributor

marknet15 commented Mar 29, 2022

Hey @kteague-tasktop at the moment as there are no set tests for the module plugin, the whole test suite is running covering all modules. If it's not too much trouble you could create a test target here for rds_instance_info to limit tests on this PR to only that which is needed:
https://github.com/ansible-collections/community.aws/tree/main/tests/integration/targets
it would just need a very small subset of the tasks from here:
https://github.com/ansible-collections/community.aws/tree/main/tests/integration/targets/rds_instance

to create a RDS instance then a call to rds_instance_info to verify it's functionality. normally the info and non info tests are bundled but in this case RDS related ops take a long time to run !

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

Thanks for this. At the least we need some minimal integration tests.

Would you be able to update tests/integration/targets/rds_instance/ to include some basic tests of the _info module? they're just playbooks/roles that run in the CI account to test the functionality of modules

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

In the interest of getting this (good) extra feature merged, I've tweaked the PR to include fixes for @marknet15's comment.

@tremble tremble added the backport-3 PR should be backported to the stable-3 branch label May 27, 2022
@ansibullbot ansibullbot removed the small_patch Hopefully easy to review label May 27, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

ansible-galaxy-importer FAILURE in 4m 09s (non-voting)
✔️ build-ansible-collection SUCCESS in 4m 41s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 22s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 43s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 13m 57s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 11m 28s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 12m 02s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 02s
✔️ ansible-test-splitter SUCCESS in 2m 21s
✔️ integration-community.aws-1 SUCCESS in 48m 21s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@markuman
Copy link
Member

markuman commented Jun 4, 2022

@tremble @marknet15 can we merge this now?

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Jun 4, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

ansible-galaxy-importer FAILURE in 3m 35s (non-voting)
✔️ build-ansible-collection SUCCESS in 5m 20s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 10s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 04s
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 13m 21s
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 13m 07s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 54s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 09s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 11s
✔️ ansible-test-splitter SUCCESS in 2m 31s
✔️ integration-community.aws-1 SUCCESS in 48m 05s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 6a2793a into ansible-collections:main Jun 4, 2022
@patchback
Copy link

patchback bot commented Jun 4, 2022

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/6a2793af5895c9ca7196de0eb42ffedea2a453ba/pr-1026

Backported as #1213

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 4, 2022
Add AWSRetry.jittered_backoff to rds_instance_info

SUMMARY
Add AWSRetry.jittered_backoff to the rds_instance_info module.
When calling rds_instance_info we have been seeing API rate limit errors from AWS. When calling this module, it usually runs to about 90-150 times in a minute before we get rate limited.
Using jittered_backoff should significantly decrease the number of times we see API rate limits here.
02:20:36 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded
02:20:36 fatal: [polaris -> localhost]: FAILED! => {"boto3_version": "1.20.22", "botocore_version": "1.23.22", "changed": false, "error": {"code": "Throttling", "message": "Rate exceeded", "type": "Sender"}, "msg": "Couldn't get instance information: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded", "response_metadata": {"http_headers": {"connection": "close", "content-length": "254", "content-type": "text/xml", "date": "Tue, 15 Mar 2022 09:20:34 GMT", "x-amzn-requestid": "5de8131e-3f59-4b04-af25-5f7083ee09b9"}, "http_status_code": 400, "max_attempts_reached": true, "request_id": "5de8131e-3f59-4b04-af25-5f7083ee09b9", "retry_attempts": 4}}

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

rds_instance_info

ADDITIONAL INFORMATION
Decorated rds_instance_info with AWSRetry.jittered_backoff

Reviewed-by: Mark Woolley <[email protected]>
Reviewed-by: Mark Chappell <None>
(cherry picked from commit 6a2793a)
@github-actions
Copy link

github-actions bot commented Jun 4, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

softwarefactory-project-zuul bot pushed a commit that referenced this pull request Jun 4, 2022
[PR #1026/6a2793af backport][stable-3] Add AWSRetry.jittered_backoff to rds_instance_info

This is a backport of PR #1026 as merged into main (6a2793a).
SUMMARY
Add AWSRetry.jittered_backoff to the rds_instance_info module.
When calling rds_instance_info we have been seeing API rate limit errors from AWS. When calling this module, it usually runs to about 90-150 times in a minute before we get rate limited.
Using jittered_backoff should significantly decrease the number of times we see API rate limits here.
02:20:36 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded
02:20:36 fatal: [polaris -> localhost]: FAILED! => {"boto3_version": "1.20.22", "botocore_version": "1.23.22", "changed": false, "error": {"code": "Throttling", "message": "Rate exceeded", "type": "Sender"}, "msg": "Couldn't get instance information: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded", "response_metadata": {"http_headers": {"connection": "close", "content-length": "254", "content-type": "text/xml", "date": "Tue, 15 Mar 2022 09:20:34 GMT", "x-amzn-requestid": "5de8131e-3f59-4b04-af25-5f7083ee09b9"}, "http_status_code": 400, "max_attempts_reached": true, "request_id": "5de8131e-3f59-4b04-af25-5f7083ee09b9", "retry_attempts": 4}}

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

rds_instance_info

ADDITIONAL INFORMATION
Decorated rds_instance_info with AWSRetry.jittered_backoff

Reviewed-by: Markus Bergholz <[email protected]>
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…ns#1026)

Add AWSRetry.jittered_backoff to rds_instance_info

SUMMARY
Add AWSRetry.jittered_backoff to the rds_instance_info module.
When calling rds_instance_info we have been seeing API rate limit errors from AWS. When calling this module, it usually runs to about 90-150 times in a minute before we get rate limited.
Using jittered_backoff should significantly decrease the number of times we see API rate limits here.
02:20:36 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded
02:20:36 fatal: [polaris -> localhost]: FAILED! => {"boto3_version": "1.20.22", "botocore_version": "1.23.22", "changed": false, "error": {"code": "Throttling", "message": "Rate exceeded", "type": "Sender"}, "msg": "Couldn't get instance information: An error occurred (Throttling) when calling the DescribeDBInstances operation (reached max retries: 4): Rate exceeded", "response_metadata": {"http_headers": {"connection": "close", "content-length": "254", "content-type": "text/xml", "date": "Tue, 15 Mar 2022 09:20:34 GMT", "x-amzn-requestid": "5de8131e-3f59-4b04-af25-5f7083ee09b9"}, "http_status_code": 400, "max_attempts_reached": true, "request_id": "5de8131e-3f59-4b04-af25-5f7083ee09b9", "retry_attempts": 4}}

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

rds_instance_info

ADDITIONAL INFORMATION
Decorated rds_instance_info with AWSRetry.jittered_backoff

Reviewed-by: Mark Woolley <[email protected]>
Reviewed-by: Mark Chappell <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@6a2793a
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…ons#1026)

inventory/aws_ec2: allow multi-entries for one host

Depends-On: ansible-collections#1066
Add an option to allow multiple duplicated entries for one single instance.
Closes: ansible-collections#950

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Jill R <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
Reviewed-by: Markus Bergholz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3 PR should be backported to the stable-3 branch bug This issue/PR relates to a bug community_review mergeit Merge the PR (SoftwareFactory) module module new_contributor Help guide this first time contributor plugins plugin (any type) traceback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants