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

Use singleflight to coalesce credentials Get() calls into a single Retrieve() #3127

Merged
merged 5 commits into from Feb 11, 2020
Merged

Use singleflight to coalesce credentials Get() calls into a single Retrieve() #3127

merged 5 commits into from Feb 11, 2020

Conversation

FugiTech
Copy link
Contributor

This fixes a bug in which a continually failing credentials provider will cause many goroutines to queue on the *Credentials.m mutex, eventually leading to memory exhaustion.

@FugiTech FugiTech requested a review from jasdel February 11, 2020 01:35
@jasdel jasdel merged commit 4172af8 into aws:master Feb 11, 2020
@FugiTech FugiTech deleted the credentials_coalesce branch February 11, 2020 23:41
aws-sdk-go-automation pushed a commit that referenced this pull request Feb 12, 2020
===

### Service Client Updates
* `service/chime`: Updates service documentation
  * Documentation updates for Amazon Chime
* `service/ds`: Updates service API and documentation
  * Release to add the ExpirationDateTime as an output to ListCertificates so as to ease customers to look into their certificate lifetime and make timely decisions about renewing them.
* `service/ec2`: Updates service API and documentation
  * This release adds support for tagging public IPv4 pools.
* `service/es`: Updates service API and documentation
  * Amazon Elasticsearch Service now offers fine-grained access control, which adds multiple capabilities to give tighter control over data. New features include the ability to use roles to define granular permissions for indices, documents, or fields and to extend Kibana with read-only views and secure multi-tenant support.
* `service/glue`: Updates service API and documentation
  * Adding ability to add arguments that cannot be overridden to AWS Glue jobs
* `service/neptune`: Updates service API and documentation
  * This launch enables Neptune start-db-cluster and stop-db-cluster. Stopping and starting Amazon Neptune clusters helps you manage costs for development and test environments. You can temporarily stop all the DB instances in your cluster, instead of setting up and tearing down all the DB instances each time that you use the cluster.
* `service/workmail`: Updates service API and documentation
  * This release adds support for access control rules management  in Amazon WorkMail.

### SDK Enhancements
* `aws/credentials`: Add grouping of concurrent refresh of credentials ([#3127](#3127)
  * Concurrent calls to `Credentials.Get` are now grouped in order to prevent numerous synchronous calls to refresh the credentials. Replacing the mutex with a singleflight reduces the overall amount of time request signatures need to wait while retrieving credentials. This is improvement becomes pronounced when many requests are being made concurrently.
aws-sdk-go-automation added a commit that referenced this pull request Feb 12, 2020
Release v1.29.1 (2020-02-12)
===

### Service Client Updates
* `service/chime`: Updates service documentation
  * Documentation updates for Amazon Chime
* `service/ds`: Updates service API and documentation
  * Release to add the ExpirationDateTime as an output to ListCertificates so as to ease customers to look into their certificate lifetime and make timely decisions about renewing them.
* `service/ec2`: Updates service API and documentation
  * This release adds support for tagging public IPv4 pools.
* `service/es`: Updates service API and documentation
  * Amazon Elasticsearch Service now offers fine-grained access control, which adds multiple capabilities to give tighter control over data. New features include the ability to use roles to define granular permissions for indices, documents, or fields and to extend Kibana with read-only views and secure multi-tenant support.
* `service/glue`: Updates service API and documentation
  * Adding ability to add arguments that cannot be overridden to AWS Glue jobs
* `service/neptune`: Updates service API and documentation
  * This launch enables Neptune start-db-cluster and stop-db-cluster. Stopping and starting Amazon Neptune clusters helps you manage costs for development and test environments. You can temporarily stop all the DB instances in your cluster, instead of setting up and tearing down all the DB instances each time that you use the cluster.
* `service/workmail`: Updates service API and documentation
  * This release adds support for access control rules management  in Amazon WorkMail.

### SDK Enhancements
* `aws/credentials`: Add grouping of concurrent refresh of credentials ([#3127](#3127)
  * Concurrent calls to `Credentials.Get` are now grouped in order to prevent numerous synchronous calls to refresh the credentials. Replacing the mutex with a singleflight reduces the overall amount of time request signatures need to wait while retrieving credentials. This is improvement becomes pronounced when many requests are being made concurrently.
jasdel added a commit to jasdel/aws-sdk-go that referenced this pull request Feb 13, 2020
Adds `GetWithContext` to `Credentials` that allows canceling getting the
credentials if the context is canceled, or times out. This fixes an
issue where API operations would ignore their provide context when
waiting for credentials to refresh.

Related to aws#3127
aws-sdk-go-automation pushed a commit that referenced this pull request Feb 14, 2020
===

### Service Client Updates
* `service/ec2`: Updates service API and documentation
  * You can now enable Multi-Attach on Provisioned IOPS io1 volumes through the create-volume API.
* `service/mediatailor`: Updates service API and documentation
* `service/securityhub`: Updates service API, documentation, and paginators
* `service/shield`: Updates service API and documentation
  * This release adds support for associating Amazon Route 53 health checks to AWS Shield Advanced protected resources.

### SDK Enhancements
* `aws/credentials`: Add support for context when getting credentials.
  * Adds `GetWithContext` to `Credentials` that allows canceling getting the credentials if the context is canceled, or times out. This fixes an issue where API operations would ignore their provide context when waiting for credentials to refresh.
  * Related to [#3127](#3127).
aws-sdk-go-automation added a commit that referenced this pull request Feb 14, 2020
Release v1.29.3 (2020-02-14)
===

### Service Client Updates
* `service/ec2`: Updates service API and documentation
  * You can now enable Multi-Attach on Provisioned IOPS io1 volumes through the create-volume API.
* `service/mediatailor`: Updates service API and documentation
* `service/securityhub`: Updates service API, documentation, and paginators
* `service/shield`: Updates service API and documentation
  * This release adds support for associating Amazon Route 53 health checks to AWS Shield Advanced protected resources.

### SDK Enhancements
* `aws/credentials`: Add support for context when getting credentials.
  * Adds `GetWithContext` to `Credentials` that allows canceling getting the credentials if the context is canceled, or times out. This fixes an issue where API operations would ignore their provide context when waiting for credentials to refresh.
  * Related to [#3127](#3127).
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

Successfully merging this pull request may close these issues.

None yet

3 participants