Skip to content

Job Retries with Backoff #2

Closed

Description

@iyashjayesh

Goal: Automatically handle transient failures.

Automatically retry jobs that return an error. The system should allow users to define a retry policy, including the maximum number of attempts and an exponential backoff strategy to avoid "thundering herd" issues.

  • wrapping the user's Job in a retry-aware function.
  • should support strategies: Constant, Linear, or Exponential backoff.

Question: Does it make sense to implement this logic inside the package itself, or should retries be handled dynamically at the service or API layer?

Activity

  1. navyn13 commented on Jan 6, 2026

    @navyn13

    Hi @iyashjayesh,

    To better handle transient failures and avoid thundering-herd issues, it would be really useful if the retry policy also supported:
    baseDelay – initial wait time before the first retry
    maxDelay – upper bound on backoff delay (especially important for exponential backoff)

    Why this matters:
    Base delay lets users control how aggressively retries begin
    Max delay prevents exponential backoff from growing too large and causing long stalls in job execution

    This would make retry behaviour safer and more predictable in production while keeping the API flexible.

  2. iyashjayesh commented on Jan 7, 2026

    @iyashjayesh
    OwnerAuthor

    @navyn13 Agreed! Those parameters are essential for production safety. I'll add both: BaseDelay & MaxDelay

    This will prevents runaway delays while keeping retries predictable. Thanks for the suggestion!

  3. navyn13 commented on Jan 7, 2026

    @navyn13

    @iyashjayesh Sounds good 👍 I can take this up and implement it.

  4. iyashjayesh commented on Jan 19, 2026

    @iyashjayesh
    OwnerAuthor

    @navyn13 any luck on this? do you need any help?

  5. pkhsaxena commented on Oct 12, 2026

    @pkhsaxena
    Contributor

    Hi @iyashjayesh, I've opened #7 to add retries with backoff, covering BaseDelay and MaxDelay as discussed above.
    It also improves observability: task IDs and kinds, structured logging via slog, an OnTaskDone hook, and vendor-agnostic metrics with Prometheus and OpenTelemetry adapters.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions