Skip to content

Commit

Permalink
chore(cli-integ): retry throttled Maven uploads (aws#24665)
Browse files Browse the repository at this point in the history
Maven uploads can fail with the following error, which indicates throttling:

```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact software.amazon.awscdk:batch-alpha:jar:2.70.0-alpha.999 from/to codeartifact (https://xxxxx.d.codeartifact.us-east-1.amazonaws.com/maven/test-0ek4hpd8q2tm/): status code: 429, reason phrase: Too Many Requests (429) -> [Help 1]
```

Catch these errors and retry them.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr authored and homakk committed Mar 28, 2023
1 parent 76c9b55 commit 496ce86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/@aws-cdk-testing/cli-integ/lib/staging/maven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export async function uploadJavaPackages(packages: string[], login: LoginInforma
console.log(`❌ ${pkg}: already exists. Skipped.`);
return 'skip';
}
if (output.toString().includes('Too Many Requests')) {
console.log(`♻️ ${pkg}: Too many requests. Retrying.`);
return 'retry';
}
return 'fail';
});
}
Expand Down

0 comments on commit 496ce86

Please sign in to comment.