Skip to content

Commit

Permalink
fix(transliterator): s3 requests are capped after 3 retries (#1445)
Browse files Browse the repository at this point in the history
The previous retry strategy used with the SDK v2 did retry for 12 times
before the back-off tipped over a threshold.
Because we are seeing tasks fail due to S3 requests throttled, this PR
brings the retries for SDK v3 in line with the previous amount. It also
adds environment variables to make the s3 concurrency and retry limits
configurable via environment variables to allow for better testing.


----

*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
  • Loading branch information
mrgrain authored Sep 10, 2024
1 parent 27f404a commit e7aa681
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const project = new CdklabsConstructLibrary({
'@aws-sdk/client-codeartifact',
'@aws-sdk/client-s3',
'@smithy/types',
'@smithy/util-retry',
'@smithy/util-stream',
'async-sema',
'aws-embedded-metrics',
Expand Down
1 change: 1 addition & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 50 additions & 10 deletions src/__tests__/__snapshots__/construct-hub.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions src/__tests__/backend/transliterator/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ test('CodeArtifact repository', () => {
Environment: stack.resolve([
{ Name: 'HEADER_SPAN', Value: 'true' },
{ Name: 'AWS_EMF_ENVIRONMENT', Value: 'Local' },
{
Name: 'MAX_CONCURRENT_S3_REQUESTS',
Value: '16',
},
{
Name: 'MAX_RETRIES_S3_REQUESTS',
Value: '12',
},
{
Name: 'CODE_ARTIFACT_DOMAIN_NAME',
Value: codeArtifact.repositoryDomainName,
Expand Down Expand Up @@ -138,6 +146,14 @@ test('VPC Endpoints', () => {
Environment: stack.resolve([
{ Name: 'HEADER_SPAN', Value: 'true' },
{ Name: 'AWS_EMF_ENVIRONMENT', Value: 'Local' },
{
Name: 'MAX_CONCURRENT_S3_REQUESTS',
Value: '16',
},
{
Name: 'MAX_RETRIES_S3_REQUESTS',
Value: '12',
},
{
Name: 'CODE_ARTIFACT_API_ENDPOINT',
Value: Fn.select(
Expand Down Expand Up @@ -214,6 +230,14 @@ test('VPC Endpoints and CodeArtifact repository', () => {
Environment: stack.resolve([
{ Name: 'HEADER_SPAN', Value: 'true' },
{ Name: 'AWS_EMF_ENVIRONMENT', Value: 'Local' },
{
Name: 'MAX_CONCURRENT_S3_REQUESTS',
Value: '16',
},
{
Name: 'MAX_RETRIES_S3_REQUESTS',
Value: '12',
},
{
Name: 'CODE_ARTIFACT_API_ENDPOINT',
Value: Fn.select(
Expand Down
Loading

0 comments on commit e7aa681

Please sign in to comment.