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

Backoff and retry status polling #124

Merged
merged 1 commit into from Oct 29, 2020
Merged

Conversation

jacobtomlinson
Copy link
Member

Fixes #56.

We currently poll for the pending container status every second until it is running. If ECS takes a long time to start we can eventually run into a ThrottlingException.

This PR catches the exception and continues retrying but with an exponential backoff to a maximum of 20 seconds. Once a request is successful it will resume polling every second until the exception is hit again.

This will continue indefinitely until the container moves to a running or failed state.

Copy link
Contributor

@eganjs eganjs left a comment

Choose a reason for hiding this comment

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

Looks pretty great, just a few comments:

  • Can the maximum backoff can be made configurable?
  • Should a note be added in the documentation to cover this?

@jacobtomlinson
Copy link
Member Author

Thanks for the review @eganjs.

The 20 second maximum is described in the AWS documentation. Do you have a reason why you would like this to be configurable?

I'm not sure this needs to be documented, this is more of a bug fix to respect the AWS API. It shouldn't affect the usage of the library.

Copy link
Contributor

@eganjs eganjs left a comment

Choose a reason for hiding this comment

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

That's a good challenge.

I've re-read through #56 and the cases I was thinking of would work fine under the implementation.

I think I was being a bit overzealous with my concerns 😅

@eganjs
Copy link
Contributor

eganjs commented Sep 22, 2020

Today the default limits for Fargate On-Demand resource count and Fargate Spot resource count were increased from 100 to 500 and 250 to 500 respectively (see https://aws.amazon.com/about-aws/whats-new/2020/09/aws-fargate-increases-default-resource-count-service-quotas/). Without this PR I suspect users of the library will be unable to leverage these increases, it would be good to get this merged ASAP unless there is more work to be done here?

@hamzahiqb hamzahiqb mentioned this pull request Oct 16, 2020
@jacobtomlinson jacobtomlinson merged commit 2f66623 into master Oct 29, 2020
@jacobtomlinson jacobtomlinson deleted the backoff-throttled-call branch October 29, 2020 16:54
@jacobtomlinson
Copy link
Member Author

Thanks for the nudge @eganjs

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.

"Rate exceeded" error on FargateCluster
2 participants