Skip to content

AIP-9672: Add resourceRetryStrategy for quota-aware retries#8

Merged
abdulazillow merged 1 commit intofeature/zgfrom
abdula/AIP-9672-resource-retry-strategy
Oct 8, 2025
Merged

AIP-9672: Add resourceRetryStrategy for quota-aware retries#8
abdulazillow merged 1 commit intofeature/zgfrom
abdula/AIP-9672-resource-retry-strategy

Conversation

@abdulazillow
Copy link
Collaborator

Description

Adds ResourceRetryStrategy field to Trigger struct enabling different retry behaviors for ResourceQuota errors vs regular validation errors. When resourceRetryStrategy is configured, quota-related errors (e.g., "exceeded quota") use the specified retry strategy while other errors use the default retryStrategy.

Configuration

Sensors can now configure separate retry strategies for resource constraint errors:

triggers:
- template:
    name: my-trigger
  retryStrategy:
    steps: 2
    duration: 5s
    factor: 2.0
  resourceRetryStrategy:  # NEW FIELD
    steps: 4
    duration: 10s
    factor: 1.5

Backward Compatibility

Maintains full backward compatibility - existing sensors continue working unchanged, while new sensors can opt into quota-aware retries. When resourceRetryStrategy is not specified, all errors use the default retryStrategy.

Test Results

Successfully tested in sandbox environment with actual ResourceQuota limits:

  | Test | Error Type                                  | Strategy Used         | Retries | Total  Time | Status   |
  |------|---------------------------------------------|-----------------------|---------|------  ------|----------|
  | #1   | Quota exceeded                              | resourceRetryStrategy | 4       | ~55s        | ✅ PASSED |
  | #2   | Validation error                            | retryStrategy         | 2       | ~6s        | ✅ PASSED |
  | #3A  | Validation error (no resourceRetryStrategy) | retryStrategy         | 2       | ~5.5s        | ✅ PASSED |
  | #3B  | Quota error (no resourceRetryStrategy)      | retryStrategy         | 2       | ~15s        | ✅ PASSED |

All tests validate correct retry strategy selection and maintain backward compatibility.

- Add ResourceRetryStrategy field to Trigger struct
- Implement error classification for resource constraint errors
- Add DoWithResourceAwareRetry function for intelligent retry selection
- Update sensor listener to use resource-aware retry logic
- Add comprehensive test coverage for new functionality
- Generate updated deepcopy code for new field
Copy link
Collaborator

@dhanashritidke11 dhanashritidke11 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for sharing the test results.

@abdulazillow abdulazillow merged commit a93db5f into feature/zg Oct 8, 2025
1 check passed
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.

3 participants