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

feat(pacmak): retry select external command invocations #2013

Merged
merged 5 commits into from
Sep 16, 2020

Conversation

RomainMuller
Copy link
Contributor

When generating packages, jsii-pacmak will defer to external tools for
compilation (dotnet, mvn, pip, ...). Those commands will typically
require some kind of network transfer (e.g: to resolve dependencies from
their standard package registry), which is susceptible to fail (due to
poor network conditions, getting throttled in CI/CD, etc...).

In order to reduce the likelihood that such failures will interrupt the
user workflow abruptly (forcing a manual retry, and possibly breaking
CI/CD workflows), back-off and retries will be performed when these
commands fail (up to 5 tentatives in total, with exponential back-off
using a 150ms base cooldown and a factor of 2).


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When generating packages, `jsii-pacmak` will defer to external tools for
compilation (`dotnet`, `mvn`, `pip`, ...). Those commands will typically
require some kind of network transfer (e.g: to resolve dependencies from
their standard package registry), which is susceptible to fail (due to
poor network conditions, getting throttled in CI/CD, etc...).

In order to reduce the likelihood that such failures will interrupt the
user workflow abruptly (forcing a manual retry, and possibly breaking
CI/CD workflows), back-off and retries will be performed when these
commands fail (up to 5 tentatives in total, with exponential back-off
using a 150ms base cooldown and a factor of 2).
@RomainMuller RomainMuller added effort/small Small work item – less than a day of effort p1 module/pacmak Issues affecting the `jsii-pacmak` module labels Sep 15, 2020
@RomainMuller RomainMuller added this to the September Release milestone Sep 15, 2020
@RomainMuller RomainMuller requested a review from a team September 15, 2020 09:35
@RomainMuller RomainMuller self-assigned this Sep 15, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 15, 2020
@RomainMuller RomainMuller force-pushed the rmuller/retry-shell-outs branch from 88cd919 to 67b4736 Compare September 15, 2020 09:45
Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

Why did the retry mechanism need to be rewritten instead of simply turned on?

*
* @default 5
*/
maxTries?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

maxAttempts then? This word grates on me for some reason.

@RomainMuller
Copy link
Contributor Author

For some reason I only noticed there was already support for retries after writing the new retry wrapper. And the old retry mechanism lacked support for back-off, making it questionnable for working around throttles / DDOS protections.

@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2020

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Sep 16, 2020
@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2020

Merging (with squash)...

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 2352134
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 66cf186 into master Sep 16, 2020
@mergify mergify bot deleted the rmuller/retry-shell-outs branch September 16, 2020 11:25
@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2020

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort module/pacmak Issues affecting the `jsii-pacmak` module p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants