Skip to content

Retry forever by default and not 3 times #19

Description

@alob-mtc

Description

Make the retry option optional and fix the retry forever behavior.

Current Behavior

  • max_retries is a u32 field
  • max_retries == 0 means retry forever (logically incorrect)
  • Default is 3 retries

Desired Behavior

  • Make max_retries an Option<u32> field
  • If max_retries is None (not set), the activity should retry forever
  • If max_retries is Some(0), the activity should not retry (0 means no retry)
  • If max_retries is Some(n) where n > 0, the activity should retry up to n times

Rationale

The current logic where 0 == retry forever is counterintuitive. The new approach is more logical:

  • None = retry forever (unlimited)
  • Some(0) = no retry
  • Some(n) = retry up to n times

Implementation Notes

  • Update ActivityOption.max_retries from u32 to Option<u32>
  • Update Activity.max_retries from u32 to Option<u32>
  • Update the retry logic in src/queue/queue.rs (around line 1187) to check for None (retry forever) instead of 0
  • Update default behavior to use None for retry forever instead of 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions