Skip to content

feat: retry on transient marketplace failures#134

Open
rpocase wants to merge 2 commits intocanonical:mainfrom
rpocase:20260311-retry-on-request-quota-failure
Open

feat: retry on transient marketplace failures#134
rpocase wants to merge 2 commits intocanonical:mainfrom
rpocase:20260311-retry-on-request-quota-failure

Conversation

@rpocase
Copy link
Contributor

@rpocase rpocase commented Mar 11, 2026

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:

  • --retry-max-retries
  • --retry-initial-delay-seconds
  • --retry-max-delay-seconds

@rpocase rpocase force-pushed the 20260311-retry-on-request-quota-failure branch from 23aac72 to 850c757 Compare March 11, 2026 16:42
@rthill91 rthill91 requested review from Copilot and rthill91 March 11, 2026 17:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 RetryConfig and retry loop in the Marketplace start_change_set driver 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.

Comment on lines +73 to +82
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)
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
rpocase added 2 commits March 11, 2026 12:30
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.
@rpocase rpocase force-pushed the 20260311-retry-on-request-quota-failure branch from 850c757 to 3efbc00 Compare March 11, 2026 17:31
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.

2 participants