Skip to content

[Enhancement] Add retry logic with exponential backoff #53

Description

@talltechy

Description

Add automatic retry with exponential backoff for transient API failures to improve reliability.

Features

  • Automatic retry on transient failures (500, 502, 503, 504)
  • Exponential backoff strategy
  • Configurable max retry attempts
  • Configurable backoff multiplier
  • Rate limit (429) handling with Retry-After header respect
  • Timeout handling

Acceptance Criteria

  • Retry decorator or mixin implemented
  • Applied to BaseAPI._request() method
  • Configurable via environment variables
  • Proper logging of retry attempts
  • Rate limit handling with Retry-After
  • Unit tests for retry logic
  • Documentation updated

Technical Approach

# Example configuration
INSIGHTVM_MAX_RETRIES=3
INSIGHTVM_BACKOFF_FACTOR=2
INSIGHTVM_RETRY_STATUSES=500,502,503,504

Context

Part of Sprint 4: Error Handling (4-6 hours)

Currently no automatic retry for transient failures. This will improve resilience in production.

See: memory-bank/github-workflow.md for workflow details

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions