JIRA: add retry/rate limit support #13786
Open
+51
−2
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 #13769
Enable JIRA Connection Retries and Rate Limiting Support
Summary
This PR enables configurable retry and timeout settings for JIRA connections to handle rate limiting (HTTP 429) and connection errors gracefully. Previously, JIRA connections had retries disabled (
max_retries=0), causing immediate failures on rate limits or transient network issues.Changes
Configuration
Added three new environment variables:
DD_JIRA_MAX_RETRIES(default:3): Maximum number of retry attempts for recoverable errors (429, 503, ConnectionError)DD_JIRA_CONNECT_TIMEOUT(default:10seconds): Connection timeout for establishing a connection to the JIRA serverDD_JIRA_READ_TIMEOUT(default:30seconds): Read timeout for waiting for a response from the JIRA serverTechnical Details
Retry Behavior
The jira library automatically retries on:
Migration Notes
No migration required. The new settings use sensible defaults that match the previous behavior for retries (now enabled with 3 retries instead of 0) and add timeout configuration.
Testing
Tested with:
Future improvements
If we encounter retry delays of over 60s, we may consider adding another layer of retries in our celery task where we just reschedule the task with a delay. This avoids blocking other waiting tasks, but has other challenges.