feat: retry on transient marketplace failures#134
feat: retry on transient marketplace failures#134rpocase wants to merge 2 commits intocanonical:mainfrom
Conversation
23aac72 to
850c757
Compare
There was a problem hiding this comment.
Pull request overview
Adds configurable retry behavior for transient AWS Marketplace change-set contention failures, aimed at making bulk/CI workflows more robust without manual intervention.
Changes:
- Introduces a
RetryConfigand retry loop in the Marketplacestart_change_setdriver path for quota/lock contention errors. - Adds CLI flags to configure retry behavior and wires them through public-offer/private-offer workflows.
- Adds typed exceptions, plus unit tests and docs describing retry behavior and usage.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
awsmp/_driver.py |
Implements retry detection/backoff around start_change_set, adds RetryConfig, and maps transient errors to typed exceptions. |
awsmp/cli.py |
Adds retry-related CLI options to multiple commands and passes a retry config into driver operations. |
awsmp/errors.py |
Adds new user-facing exception types for service quota exceeded and resource-in-use conditions. |
tests/test_driver.py |
Adds tests for retry behavior and error mapping; updates an assertion for the new get_response signature. |
tests/test_cli.py |
Adds tests ensuring CLI commands pass retry options through to driver APIs. |
docs/public-offer/index.rst |
Documents retry flags, supported workflows, and an example for public-offer commands. |
docs/private-offer/index.rst |
Documents retry flags and an example for private-offer create. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| class MarketplaceResourceInUseException(AWSException): | ||
| def __init__(self, error_msg: str): | ||
| message = f""" | ||
|
|
||
|
|
||
| {error_msg} | ||
| Requested entities are currently locked by another in-flight change set. | ||
| Please wait and retry. | ||
| """ | ||
| super().__init__(message) |
There was a problem hiding this comment.
The MarketplaceResourceInUseException message string has inconsistent indentation (some lines start with 4–8 spaces). This will show up in user-facing output and makes the message harder to read. Align this with the formatting used by the other exceptions in this module (no leading indentation inside the triple-quoted string, or dedent/strip).
this adds two new cli arguments for all public-offer update workflows and public-offer create workflow. --retry-max-retries: defaults to 0 --retry-initial-delay-seconds: defaults to 60 --retry-max-delay-seconds: 300 retry max delay includes incremental back off to get to the max wait more quickly.
this adds documentation for the new retry mechanisms for public-offer update workflows and private-offer create.
850c757 to
3efbc00
Compare
this adds new cli arguments to target specific transient failures in marketplace requests. specifically, quota issues and request already in flight. this is to avoid having to babysit situations where you are running bulk updates in CI.
new flags: