Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

Fixes task polling failures when hitting API rate limits during --wait operations.

Problem

When waiting for async tasks (like cost report generation), the CLI polls the /tasks/{id} endpoint. With aggressive polling, users can hit the API rate limit (429), causing the operation to fail even though the task completed successfully:

⠁ Task 47934620-3b6d-4c0b-88f4-9c14bb428311: processing-completed [00:03:15]
ERROR: API error (429): You have exhausted your API Request Quota

Additionally, the cost report API returns processing-completed as a terminal state, which was not recognized.

Changes

redis-cloud crate

  • Add RateLimited error variant for 429 responses (was falling through to generic ApiError)
  • Add is_retryable() method to CloudError - returns true for 429, 503, and connection errors

redisctl crate

  • Add processing-completed as a terminal state (alongside completed, succeeded, etc.)
  • Implement retry with exponential backoff when fetching task status:
    • Up to 5 retry attempts
    • Backoff from 1s → 2s → 4s → 8s → 16s (capped at 30s)
    • Only retries on is_retryable() errors
    • Shows progress: "Rate limited, retrying in 4s (2/5)"

Testing

  • Added unit tests for is_retryable() method
  • Added tests for processing-completed terminal state recognition
  • All existing tests pass

Related

Partially addresses #585 (cost report CLI improvements)

…polling

- Add RateLimited error variant to CloudError for 429 responses
- Add is_retryable() method to CloudError to identify transient errors
- Add processing-completed as a terminal state (used by cost report API)
- Implement retry with exponential backoff for 429/503 errors in task polling
- Retry up to 5 times with delays from 1s to 30s before failing

This fixes an issue where long-running --wait operations would fail with
'API error (429): You have exhausted your API Request Quota' due to
aggressive polling without backoff.

Closes #585 (partial)
… with global -o flag

The field name 'output' conflicted with the global OutputFormat flag,
causing a panic at runtime. Renamed to 'file' (--file/-f).
Updates from 0.7 to 0.8.3 which includes:
- New text/NLP toolkit functions
- Discovery module improvements
- from_entries alias for from_items
- Documentation improvements
@joshrotenberg joshrotenberg merged commit c3c6936 into main Jan 23, 2026
29 checks passed
@joshrotenberg joshrotenberg deleted the fix/task-polling-rate-limits branch January 23, 2026 21:55
@joshrotenberg joshrotenberg mentioned this pull request Jan 23, 2026
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