feat: [Geneva Exporter] Add retry logic for Geneva uploader. #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #309
Design discussion issue (if applicable) #
Changes
This PR introduces a new retry module and integrates it into the Geneva uploader to handle transient failures gracefully. The implementation provides configurable retry logic with support for retriability checking, while also including TODOs for future enhancements like exponential backoff and jitter.
New Retry Module (
retry.rs
):RetryConfig
struct with configurable max retries and delayretry_with_config()
- Simple retry function with fixed delaysretry_with_config_and_check()
- Advanced retry with retriability checkingUploader Integration (
uploader.rs
):retry_config
toGenevaUploaderConfig
is_retriable()
method onGenevaUploaderError
to intelligently determine which errors should trigger retriesupload()
method to useretry_with_config_and_check()
for automatic retries.Client Integration (
client.rs
):retry_config
field toGenevaClientConfig
Error Retriability Logic: The
is_retriable()
method implements smart error classification:The retry wrapper is designed to have minimal performance impact: When operations succeed on the first attempt (the common case), the retry wrapper adds only:
is_retriable()
is never called on success)Unit tests added to test retriable and non-retriable uploads.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes