Skip to content

Add opt-in infinite retries with elapsed-time guard#120

Open
kamui wants to merge 3 commits into
mainfrom
feat/infinite-retries
Open

Add opt-in infinite retries with elapsed-time guard#120
kamui wants to merge 3 commits into
mainfrom
feat/infinite-retries

Conversation

@kamui
Copy link
Copy Markdown
Owner

@kamui kamui commented Mar 7, 2026

Summary

  • add opt-in infinite retry support via tries: :infinite without changing existing finite retry defaults
  • enforce a safety guard by requiring max_elapsed_time to be finite when infinite retries are enabled
  • simplify retry interval planning and use lazy capped backoff intervals for infinite retries
  • document the new option in README and CHANGELOG

Testing

  • bundle exec rspec
  • bundle exec rubocop lib/retriable.rb lib/retriable/exponential_backoff.rb
  • bundle exec rubocop spec/exponential_backoff_spec.rb
  • git diff --check

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as outdated.

kamui added 2 commits May 22, 2026 23:21
Support infinite retry loops bounded by max_elapsed_time, useful for
long-running worker processes. Raises ArgumentError if max_elapsed_time
is not finite or if custom intervals are empty.

Extracts interval_for on ExponentialBackoff for lazy per-attempt
interval computation without pre-allocating an array.
@kamui kamui force-pushed the feat/infinite-retries branch from e121ead to 4acdaa6 Compare May 23, 2026 03:29
@kamui kamui marked this pull request as ready for review May 23, 2026 03:33
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